806 Commits

Author SHA1 Message Date
Chet Haase
3d100d97a5 Merge "Fix logic of animator start/cancel/end callbacks" 2012-04-18 07:41:45 -07:00
Craig Mautner
a51a9564fd Add call-stack reporting methods into Debug
Added two public methods to Debug. These methods return a String
indicating the caller (getCaller()) or callers (getCallers(int depth))
of the calling method. The String indicates the class, method and line
number of the caller(s). Similar to using Throwable.fillInStackTrace()
but much more concise.

Change-Id: I53d0085aa50e4501d28e8eb3ad5b91ef700ac218
2012-04-17 17:25:50 -07:00
Chet Haase
17cf42cb85 Fix logic of animator start/cancel/end callbacks
The callbacks for animators in some corner cases were not being
called correctly. For example, startDelayed animators that were
started and then ended didn't send out the proper events.

This CL fixes that logic. Specifically:
- An animator that is end()'d will implicitly start() itself and then
assign an end value. This was already the case, but listeners were not
getting notified. Now this situation causes callbacks to listeners for
both the start and end events.
- startDelayed animators that are end()'d or cancel()'d prior to finishing
the startDelay phase will send out events (start and cancel/end, as appropriate)
to listeners.

Change-Id: I40a0f2fdb19d9ec7c3726a91363686c6ecb7d915
2012-04-17 13:58:44 -07:00
Chris Wren
3a59d6e26d A layout that switches between its children based on the requested layout height.
Change-Id: I5a4e5892fbed7cab2470e458a38accbbcb05ae51
2012-04-17 09:06:21 -07:00
Kenny Root
b7c24702c2 Better error reporting for PackageManager tests
The unit tests were eating failure reasons. Remove some assertions so
the useful messages percolate up to the JUnit report.

Change-Id: Ica8efe403ca3eb4f0c4f2a18939a22085f74a08f
2012-04-15 12:46:22 -07:00
Kenny Root
52c5acacd4 Build "install" resource for PMS tests
All the APKs in the FrameworkCoreTests's res/raw directory should be
built by source.

This change makes one more built from source that was causing test
failures with mismatched certificates.

Change-Id: I1baed15477ee39c45d3d77f9b02b81f771a16ca2
2012-04-15 12:40:14 -07:00
Svetoslav Ganov
4213804541 Accessibility focus - framework
Usefulness: Keep track of the current user location in the screen when
            traversing the it. Enabling structural and directional
            navigation over all elements on the screen. This enables
            blind users that know the application layout to efficiently
            locate desired elements as opposed to try touch exploring the
            region where the the element should be - very tedious.

Rationale: There are two ways to implement accessibility focus One is
           to let accessibility services keep track of it since they
           have access to the screen content, and another to let the view
           hierarchy keep track of it. While the first approach would
           require almost no work on our part it poses several challenges
           which make it a sub-optimal choice. Having the accessibility focus
           in the accessibility service would require that service to scrape
           the window content every time it changes to sync the view tree
           state and the accessibility focus location. Pretty much the service
           will have to keep an off screen model of the screen content. This
           could be quite challenging to get right and would incur performance
           cost for the multiple IPCs to repeatedly fetch the screen content.
           Further, keeping virtual accessibility focus (i.e. in the service)
           would require sync of the input and accessibility focus. This could
           be challenging to implement right as well. Also, having an unlimited
           number of accessibility services we cannot guarantee that they will
           have a proper implementation, if any, to allow users to perform structural
           navigation of the screen content. Assuming two accessibility
           services implement structural navigation via accessibility focus,
           there is not guarantee that they will behave similarly by default,
           i.e. provide some standard way to navigate the screen content.
           Also feedback from experienced accessibility researchers, specifically
           T.V Raman, provides evidence that having virtual accessibility focus
           creates many issues and it is very hard to get right.
           Therefore, keeping accessibility focus in the system will avoid
           keeping an off-screen model in accessibility services, it will always
           be in sync with the state of the view hierarchy and the input focus.
           Also this will allow having a default behavior for traversing the
           screen via this accessibility focus that is consistent in all
           accessibility services. We provide accessibility services with APIs to
           override this behavior but all of them will perform screen traversal
           in a consistent way by default.

Behavior:  If accessibility is enabled the accessibility focus is the leading one
           and the input follows it. Putting accessibility focus on a view moves
           the input focus there. Clearing the accessibility focus of a view, clears
           the input focus of this view. If accessibility focus is on a view that
           cannot take input focus, then no other view should have input focus.
           In accessibility mode we initially give accessibility focus to the topmost
           view and no view has input focus. This ensures consistent behavior accross
           all apps. Note that accessibility focus can move hierarchically in the
           view tree and having it at the root is better than putting it where the
           input focus would be - at the first input focusable which could be at
           an arbitrary depth in the view tree. By default not all views are reported
           for accessibility, only the important ones. A view may be explicitly labeled
           as important or not for accessibility, or the system determines which one
           is such - default. Important views for accessibility are all views that are
           not dumb layout managers used only to arrange their chidren. Since the same
           content arrangement can be obtained via different combintation of layout
           managers, such managers cannot be used to reliably determine the application
           structure. For example, a user should see a list as a list view with several
           list items and each list item as a text view and a button as opposed to seeing
           all the layout managers used to arrange the list item's content.
           By default only important for accessibility views are regared for accessibility
           purposes. View not regarded for accessibility neither fire accessibility events,
           nor are reported being on the screen. An accessibility service may request the
           system to regard all views. If the target SDK of an accessibility services is
           less than JellyBean, then all views are regarded for accessibility.
           Note that an accessibility service that requires all view to be ragarded for
           accessibility may put accessibility focus on any view. Hence, it may implement
           any navigational paradigm if desired. Especially considering the fact that
           the system is detecting some standard gestures and delegates their processing
           to an accessibility service. The default implementation of an accessibility
           services performs the defualt navigation.

bug:5932640
bug:5605641

Change-Id: Ieac461d480579d706a847b9325720cb254736ebe
2012-04-13 19:05:24 -07:00
Jeff Sharkey
8fc27e8b87 Support metered Wi-Fi NetworkPolicy.
Add networkId field to NetworkIdentity to identify Wi-Fi networks by
SSID.  Add support for policies without usage cycles.

Only apply mobile policies when SIM state is ready, which is cleaner
than just checking for airplane mode.  Also avoids creating no-op
default policies when subscriberId is null.

Bug: 3001465, 3291052
Change-Id: I1f8aaa49a5db306df022c402ea7f3f5d4bc0cfc7
2012-04-05 16:02:25 -07:00
Jeff Sharkey
b14ad8cc8c Migrate to shared MockWebServer.
Bug: 4726601
Change-Id: Ibbe71b5785a64bd2883c46b83e721fba9a25afa2
2012-03-29 14:17:03 -07:00
Gilles Debunne
f31af70915 Merge "Added a unit test for DynamicLayout#updateBlocks" 2012-03-28 17:49:24 -07:00
Kenny Root
fb32ab903a Update Wifi tests
Wifi tests used old WifiConfiguration values. This updates it to the new
values.

Change-Id: I14498aebba50f906181fa377b84855eae3d046fc
2012-03-27 21:12:08 -07:00
Gilles Debunne
1e130b2abc Added a unit test for DynamicLayout#updateBlocks
Change-Id: I1824ebeae2bbb5c60a65de36fe1696bf003347c9
2012-03-26 16:39:25 -07:00
Jesse Wilson
e300d82828 Merge "Add an API to expose Next Protocol Negotiation (NPN)." 2012-03-26 10:14:44 -07:00
Jesse Wilson
f5fb5e8096 Add an API to expose Next Protocol Negotiation (NPN).
Bug: http://b/4190756
Change-Id: If904f7ff440391a6adb2963eb2ecb990140ab7cc
2012-03-25 19:43:01 -04:00
Amith Yamasani
483f3b06ea Package restrictions per user
Packages can be enabled/disabled per user.
This requires maintaining stopped/launched states and
enabled / disabled components and packages per user.

Refactored pm.Settings and PackageSettingsBase to keep
track of states per user.

Migrated the stopped-packages.xml to users/<u>/package-restrictions.xml

Changed intent resolution to handle individual user restrictions.
Bunch of IPackageManager calls now have a userId argument.
Make AppWidgetService handle removals of packages.

Added some tests for pm.Settings and PackageManager.

Change-Id: Ia83b529e1df88dbcb3bd55ebfc952a6e9b20e861
2012-03-22 10:08:24 -07:00
David Hu
ca4aab9cd7 BandwidthTestCase
A test case that measures bandwidth metrics when annotated with
android.test.BandwidthTest and adds the metrics to the status bundle

Change-Id: I085110c66c7fcf651aefeeac3d4cdf5bd438ff67
2012-03-19 18:33:58 -07:00
Jake Hamby
3e3c3f80a9 Add support for CMAS warning notifications over CDMA.
Refactor SMS Cell Broadcast support to enable receiving CMAS warning
notifications over CDMA. The CellBroadcastReceiver app must also be
updated with the corresponding change. All cell broadcasts are now
delivered as a Parcelable SmsCbMessage object in the "message" extra
of the SMS_CB_RECEIVED_ACTION or SMS_EMERGENCY_CB_RECEIVED_ACTION,
instead of as a GSM/UMTS "pdu" byte array.

Existing functionality for ETWS and CMAS alerts over GSM/UMTS continues
to be supported using the new radio-technology independent SmsCbMessage
and related objects. Test cases are added to verify that valid and
invalid broadcast data is handled appropriately.

Unit testing discovered a bug in the BitwiseOutputStream utility class
used by the added test cases. When the BitwiseOutputStream object must be
expanded (in the private possExpand() method), the mEnd field is not
updated to the new array size. This causes a new array to be allocated
on every new write, and for all data beyond the original array allocation
to be replaced with zeroes. Fixed by adding a line to possExpand() to
update mEnd. Added a test case to BitwiseStreamsTest to verify the fix.
Besides the test cases, BitwiseOutputStream is only used by BearerData in
two places, both of which allocate a sufficient initial buffer. So the
bug in BitwiseOutputStream is not critical to fix for normal operation,
but should be fixed so that the test cases using it function correctly.

Bug: 5856308
Change-Id: I201ecbf11607fd200aaae3cbb32561efabf65672
2012-03-13 15:31:33 -07:00
Fabrice Di Meglio
41efc44754 Merge "Move LocalUtil unit tests from Frameworks to CTS" 2012-03-13 12:51:59 -07:00
Fabrice Di Meglio
1103beee44 Move LocalUtil unit tests from Frameworks to CTS
Change-Id: I9f3333a4fdf7ccbe71e5bd5a9bd0104551efb724
2012-03-13 12:49:53 -07:00
Xia Wang
4b87e4a56c Merge "Fix test flakiness" 2012-03-12 17:55:18 -07:00
Xia Wang
6d3c2f0cad Fix test flakiness
Disable soft AP before start the wifi stress test.
If soft AP test failed with AP enabled, the wifi client can not be
enabled.

Change-Id: Ie6950f6b5b662727f2e811d9b81aeb0f4f7cda91
2012-03-12 13:58:45 -07:00
Fabrice Di Meglio
05f692e805 Merge "Make Gravity RTL APIs public" 2012-03-12 10:54:42 -07:00
Fabrice Di Meglio
e8dc07dcdb Make Gravity RTL APIs public
- also move unit tests to CTS
- also small improvement for View Javadoc

Change-Id: I166d5a10f4a00f1b46c90468c8b11906b438e1ea
2012-03-09 17:32:16 -08:00
Xia Wang
d65a4f62fe Merge "Allow CM/WIFI tests running with wifi-only flag." 2012-03-09 17:17:51 -08:00
Xia Wang
776cca3b3a Allow CM/WIFI tests running with wifi-only flag.
Change-Id: I12ab8f6f0335574a5af6db497ed76e6d5fec3ab7
2012-03-09 16:59:39 -08:00
Ken Wakasa
f76a50ce8f Fix obvious typos under frameworks/base/core
Change-Id: Ia5fc3db1bb51824e7523885553be926bcc42d736
2012-03-09 22:48:43 +09:00
Xia Wang
21b4d6b7a5 Merge "Fix CM test http://b/issue?id=6125619" 2012-03-08 16:01:00 -08:00
Xia Wang
27284da88c Fix CM test
http://b/issue?id=6125619

Change-Id: I33306619424ab54281aaf592c78581179ebbfc6e
2012-03-08 15:57:26 -08:00
Amith Yamasani
28ca8f9f95 Merge "Make SyncManager and AccountManagerService multi-user aware." 2012-03-08 15:55:20 -08:00
Amith Yamasani
04e0d265e3 Make SyncManager and AccountManagerService multi-user aware.
AccountManagerService
- Maintain multiple account lists, one per user
- Keep multiple databases of accounts
- Account db moved to /data/system/users/<userid>/

SyncManager
- SyncStorageEngine keeps track of multiple users' accounts.
- SyncQueue maintained as a single instance, queueing requests from
  multiple users.
- Changed some methods to take userId arguments
- Removed some deadc0de
- Store the userId in the SyncOperation, so we know which provider
  instance to bind to when queued operations are processed.

ContentService
- Pass along the userid to sync manager calls.

ActivityManagerService:
- Fixed a bug in cancelIntentSender
- Don't bring other user's task forward when resetting tasks.

Updated tests

Change-Id: If317340ef68e902787aa3f5ceb4cf96f14aea695
2012-03-08 10:52:36 -08:00
Jeff Sharkey
8f409bcd4b Merge "Caliper benchmarks for Parcel." 2012-03-07 12:07:01 -08:00
Jeff Sharkey
a197e37f7f Caliper benchmarks for Parcel.
Bug: 6111276
Change-Id: I4b89e4c14d2dc20e71bbaed78f285e6d539a1f0f
2012-03-06 17:21:01 -08:00
Fabrice Di Meglio
42b40c0ed8 Merge "Fix bug #4972463 Update CTS tests for TextView textDirection" 2012-03-06 11:48:14 -08:00
Fabrice Di Meglio
e9c0d1495b Fix bug #4972463 Update CTS tests for TextView textDirection
- move unit tests from Frameworks to CTS

Change-Id: I4598d8e99850f49e660c5bb3fb6025e71c635635
2012-03-05 16:22:22 -08:00
Jonathan Dixon
3c90952036 Refactor WebView to be a thin proxy class
Splits interface and implementation; all client calls are forwarded
to an abstract WebViewProvider interface, and the existing implementation
moved into the WebViewClassic implementor of this interface.

Originally taken from a snapshot from the development branch, by:
git diff HEAD 9a4c328a54cc05e5 | git apply
- but then rebased to keep up to date with master

Interdepends on webkit and Browser changes:
https://android-git.corp.google.com/g/158979
https://android-git.corp.google.com/g/167911

Change-Id: I91403f32654ff308934e95c832d17b292a7d9b2e
2012-03-02 11:17:47 +00:00
Tsu Chiang Chuang
756fe38d08 am 6053b195: am bb69bde5: am 3e701270: Merge "extend timeout to allow for more time for the device to connect." into ics-mr1
* commit '6053b195bcd49676b46b2257f6e1da04d0b4d9a5':
  extend timeout to allow for more time for the device to connect.
2012-03-01 17:12:55 -08:00
Irfan Sheriff
d3975a9177 Fix WifiManager async API
Fix the current asynchronous API to use callback like the way
was done with p2p API.

In the process, fix the use of WPS

Change-Id: Ib6f8714cf51b3525b655948268804e7eaaf17587
2012-03-01 13:57:23 -08:00
Tsu Chiang Chuang
4b1afab106 extend timeout to allow for more time for the device to connect.
Change-Id: If3929ca69a5025c7048d57276813c270229a76db
2012-03-01 12:28:14 -08:00
Jake Hamby
b303b42816 Merge "Revert "Add support for CMAS warning notifications over CDMA." I'll submit again when the app change is ready." 2012-02-29 14:04:48 -08:00
Jake Hamby
efba344b5a Revert "Add support for CMAS warning notifications over CDMA." I'll submit again when the app change is ready.
This reverts commit 0c49f03a0429b5c0c4a619256f7bca86a4997ae8
2012-02-29 14:00:12 -08:00
Jake Hamby
7b0eb33c3a Merge "Add support for CMAS warning notifications over CDMA." 2012-02-29 12:41:38 -08:00
Fabrice Di Meglio
3fb824bae3 Fix bug #5217606 LocaleUtils constants TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE and TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE should be renamed
- replace them by the View constants

Change-Id: I7c2bf0213319247d3db369b6f7c36771fdf3e509
2012-02-28 18:08:11 -08:00
Jake Hamby
0c49f03a04 Add support for CMAS warning notifications over CDMA.
Refactor SMS Cell Broadcast support to enable receiving CMAS warning
notifications over CDMA. The CellBroadcastReceiver app must also be
updated with the corresponding change. All cell broadcasts are now
delivered as a Parcelable SmsCbMessage object in the "message" extra
of the SMS_CB_RECEIVED_ACTION or SMS_EMERGENCY_CB_RECEIVED_ACTION,
instead of as a GSM/UMTS "pdu" byte array.

Existing functionality for ETWS and CMAS alerts over GSM/UMTS continues
to be supported using the new radio-technology independent SmsCbMessage
and related objects. Test cases are added to verify that valid and
invalid broadcast data is handled appropriately.

Unit testing discovered a bug in the BitwiseOutputStream utility class
used by the added test cases. When the BitwiseOutputStream object must be
expanded (in the private possExpand() method), the mEnd field is not
updated to the new array size. This causes a new array to be allocated
on every new write, and for all data beyond the original array allocation
to be replaced with zeroes. Fixed by adding a line to possExpand() to
update mEnd. Added a test case to BitwiseStreamsTest to verify the fix.
Besides the test cases, BitwiseOutputStream is only used by BearerData in
two places, both of which allocate a sufficient initial buffer. So the
bug in BitwiseOutputStream is not critical to fix for normal operation,
but should be fixed so that the test cases using it function correctly.

Bug: 5856308
Change-Id: Ie3e6af747976ce9b8a3e71e76fec71709cf86545
2012-02-28 16:49:17 -08:00
Tsu Chiang Chuang
541710a9ae am c16d9de7: am a626f8d6: am 2d559b53: Merge "fix NPE in race condition." into ics-mr1
* commit 'c16d9de72996950ec7f55af80d2864cd2abad1c2':
  fix NPE in race condition.
2012-02-23 08:34:44 -08:00
Svetoslav Ganov
0d04e24553 Improving accessibility APIs used for UI automation.
1. UiTestAutomationBridge was accessing the root node in the
   active window by tracking the accessibility event stream
   and keeping the last active window changing event. Now
   the bridge is stateless and the root node is fetched by
   passing special window and view id with the request to
   the system.

2. AccessibilityNodeInfos that are cached were not finished,
   i.e. not sealed, causing exception when trying to access
   their children or rpedecessors.

3. AccessibilityManagerService was not properly restoring its
   state after the UI automation bridge disconnects from it.
   I particular the devices was still in explore by touch mode
   event if no services are enabled and the sutomation bridge
   is disconnected.

4. ViewRootImpl for the focused window now fires accessibility
   events when accessibility is enabled to allow accessibility
   services to determine the current user location.

5. Several missing null checks in ViewRootImpl are fixed since
   there were scenraios in which a NPE can occur.

6. Update the internal window content querying tests.

7. ViewRootImpl was firing one extra focus event.
bug:6009813
bug:6026952

Change-Id: Ib2e058d64538ecc268f9ef7a8f36ead047868a05
2012-02-21 17:09:09 -08:00
Tsu Chiang Chuang
4fe25f693a fix NPE in race condition.
Change-Id: Ic1df67f8a5379ff1cd804fb55e143f078e369ccf
2012-02-16 14:46:02 -08:00
Xia Wang
16b7ddcfe6 Remove airplane mode related wifi test for Wi-Fi only devices.
Change-Id: I5b319b98ac68c0b7f053c5baf084c3138db8fe07
2012-02-16 10:00:33 -08:00
Jesse Wilson
18c227ba72 Implement the (hidden) ExtendedResponseCache interface.
Bug: http://code.google.com/p/android/issues/detail?id=25418
Change-Id: I4b20d576bac7036f94e57db7124de44f5b8d75be
2012-02-15 16:53:57 -05:00
Svetoslav Ganov
b36a0ac970 Incorrect behavior of View clear focus v2.0.
The framework tries to have a focused view all the time. For
that purpose when a view's focus is cleared the focus is given
to the first focusable found from the top. The implementation
of this behavior was causing the following issues:

1. If the fist focusable View tries to clear its focus it
   was getting focus but the onFocusChange callbacks were not
   properly invoked. Specifically, the onFocusChange for
   gaining focus was called first and then the same
   callback for clearing focus. Note that the callback
   for clearing focus is called when the View is already
   focused.

2. If not the first focusable View tries to clear focus,
   the focus is given to another one but the callback
   for getting focus was called before the one for clearing,
   so client code may be mislead that there is more than
   one focused view at a time.

3. (Nit) The implementaion of clearFocus and unFocus in ViewGroup
   was calling the super implementaion when there is a
   focused child. Since there could be only one focused View,
   having a focused child means that the group is not focused
   and the call to the super implementation is not needed.

4. Added unit tests that verify the correct behavior, i.e.
   the focus of the first focused view cannot be cleared
   which means that no focus change callbacks are invoked.
   The callbacks should be called in expected order.
   Now the view focus clear precedes the view focus gain
   callback. However, in between is invoked the global
   focus change callback with the correct values. We may
   want to call that one after the View callbacks. If
   needed we can revisit this.

Change-Id: I8cfb141c948141703093cf6fa2037be60861cee0
2012-02-14 17:50:51 -08:00
Amith Yamasani
dd29f8c4e3 Merge "Revert "Incorrect behavior of View clear focus."" 2012-02-14 15:52:17 -08:00