6508 Commits

Author SHA1 Message Date
Irfan Sheriff
43d8a95fa8 Merge "Improve Wi-Fi hand-off" 2012-02-29 19:33:06 -08:00
Irfan Sheriff
07573b3249 Improve Wi-Fi hand-off
When Wi-fi connects at L2 layer, the beacons reach and the device
can maintain a connection to the access point, but the application
connectivity can be flaky (due to bigger packet size exchange).

We now use Watchdog to monitor the quality of the last hop on
Wi-Fi using signal strength and ARP connectivity as indicators
to decide if the link is good enough to switch to Wi-Fi as the uplink.

ARP pings are useful for link validation but can still get through
when the application traffic fails to go through and thus not best indicator
real packet loss since they are tiny packets (28 bytes) and have
much low chance of packet corruption than the regular data
packets.

Signal strength and ARP used together ends up working well in tests.
The goal is to switch to Wi-Fi after validating ARP transfer
and RSSI and then switching out of Wi-Fi when we hit a low
signal strength threshold and waiting until the signal strength
improves and validating ARP transfer.

Change-Id: Ica593291ec7772da892f03cf45b649635b730c47
2012-02-29 17:33:36 -08:00
Christopher Tate
8662cab5c6 Merge: Introduce UpdateLocks
An "UpdateLock" works similarly to a wake lock in API: the caller is
providing a hint to the OS that now is not a good time to interrupt
the user/device in order to do intrusive work like applying OTAs.
This is particularly important for headless or kiosk-like products
where ordinarily the update process will be automatically scheduled
and proceed without user or administrator intervention.

UpdateLocks require that the caller hold the new signatureOrSystem
permission android.permission.UPDATE_LOCK.  acquire() and release()
will throw security exceptions if this is not the case.

The "is now convenient?" state is expressed to interested parties
by way of a sticky broadcast sent only to registered listeners.  The
broadcast is protected; only the system can send it, so listeners
can trust it to be accurate.  The broadcast intent also includes a
timestamp (System.currentTimeMillis()) to help inform listeners that
wish to implement scheduling policies based on when the device became
idle.

The API change here is a tiny one: a dump(PrintWriter) method has been
added to the TokenWatcher class to facilitate getting information out
of it for dumpsys purposes.  UpdateLock itself is still @hide.

Bug 5543442

Change-Id: I3709c831fc1883d7cb753cd2d3ee8e10a61e7e48
2012-02-29 14:05:24 -08:00
Craig Mautner
c38358025d Merge changes I08fcd278,I1f496bb7
* changes:
  Detect animation completions like we used to. Previous approximations weren't indicating completion and windows weren't being layered correctly as a result.
  debug
2012-02-29 06:18:23 -08:00
satok
a6bae56fc5 Merge "Unblock IPC call in TextServicesManagerService" 2012-02-28 17:56:43 -08:00
Craig Mautner
343511c9ec Detect animation completions like we used to.
Previous approximations weren't indicating completion and windows weren't being layered correctly as a result.

Change-Id: I08fcd278485bb87dc10bca257b9f8073108753f3
2012-02-28 17:34:22 -08:00
Craig Mautner
ba64dfe872 debug
Change-Id: I1f496bb71068b6c3a09095c39fb04c9f4153e051
2012-02-28 17:34:21 -08:00
Jeff Sharkey
8097e1c567 Merge "Disable verbose NetworkStats logging." 2012-02-28 15:14:19 -08:00
Jeff Sharkey
e7bb71d269 Disable verbose NetworkStats logging.
Bug: 6076584
Change-Id: I4efcda2b474f623f4fe70db8b43b0aa69017d749
2012-02-28 15:13:08 -08:00
Dianne Hackborn
00e6fc4c73 am 4953ec1c: am a2e0e3b5: am 27e20ccd: Merge "Fix issue #6073913: onActivityResult() not getting called..." into ics-mr1
* commit '4953ec1c71c4c2c134da2c969945c0d8b4fcb03c':
  Fix issue #6073913: onActivityResult() not getting called...
2012-02-28 15:10:39 -08:00
Dianne Hackborn
4953ec1c71 am a2e0e3b5: am 27e20ccd: Merge "Fix issue #6073913: onActivityResult() not getting called..." into ics-mr1
* commit 'a2e0e3b5f63dc741fd5e54f45f8dde1a3cb58c6c':
  Fix issue #6073913: onActivityResult() not getting called...
2012-02-28 15:07:43 -08:00
Jean-Baptiste Queru
973481d667 am ccd08b8d: am e939edb5: am f418738c: am d7fa7dee: Merge "Fixes update of extras Bundle in new Locations for GPS Provider"
* commit 'ccd08b8de9dc4c9cfaee93cbbcc7053cc9e8d96f':
  Fixes update of extras Bundle in new Locations for GPS Provider
2012-02-28 14:59:18 -08:00
Dianne Hackborn
5c607433e3 Fix issue #6073913: onActivityResult() not getting called...
...if the process is killed and restarted

Try to ensure that in all cases we deliver an activity result if one
was requested.

Change-Id: Id43e830d2ee782f98ed1e3b68e5e16f3258d4ad8
2012-02-28 14:45:23 -08:00
Jean-Baptiste Queru
e939edb5b4 am f418738c: am d7fa7dee: Merge "Fixes update of extras Bundle in new Locations for GPS Provider"
* commit 'f418738c64413b818e2dc507c912c2678876632f':
  Fixes update of extras Bundle in new Locations for GPS Provider
2012-02-28 13:33:44 -08:00
Jean-Baptiste Queru
f418738c64 am d7fa7dee: Merge "Fixes update of extras Bundle in new Locations for GPS Provider"
* commit 'd7fa7deef9bc0cf22bf450fdb062327697c087c4':
  Fixes update of extras Bundle in new Locations for GPS Provider
2012-02-28 13:30:39 -08:00
satok
4e713f1441 Unblock IPC call in TextServicesManagerService
Bug: 5471520
Change-Id: Iedf2c2cdd8d4834545d06d72ade3ce211b104b1d
2012-02-28 17:00:46 +09:00
Dave Burke
e5c484cb55 Merge "Increase max size of log size by 50% on userdebug builds." 2012-02-27 17:01:38 -08:00
Dave Burke
0132a952f7 Increase max size of log size by 50% on userdebug builds.
Useful especially for last kmsg (e.g. IMG/DSS logs truncate
and loose useful info). Since this is a max, won't affect files
that are already shorter than 64kb.

Change-Id: Ia5bb178678067e69384285e8c338dc8cb6ad071b
2012-02-27 16:46:38 -08:00
Craig Mautner
83eaab5b43 Fix bug introduced when moving animation step out from between assignments to wasAnimating and nowAnimating.
Now wasAnimating once again contains the animation state prior to the animation step.

Change-Id: I2b53bd3f62228183233ab36f0ebe44c0344d2351
2012-02-27 16:15:13 -08:00
Dianne Hackborn
5265466e8a Merge "New development permissions." 2012-02-24 18:40:37 -08:00
Dianne Hackborn
0aec3ea6de am 911b505f: am dc5fa185: am 133dc2d7: Merge "Fix issue #6048808: sometimes auto-correct is inactive" into ics-mr1
* commit '911b505f11c719906985f169a4f45930bdec8695':
  Fix issue #6048808: sometimes auto-correct is inactive
2012-02-24 15:44:55 -08:00
Dianne Hackborn
7663d80f6b Fix issue #6048808: sometimes auto-correct is inactive
My previous change to speed up the time the IME is dismissed was
fundamentally flawed.  That change basically switched the order
the application called the input method manager service from doing
startInput() and then windowGainedFocus(), to first windowGainedFocus()
and then startInput().

The problem is that the service relies on startInput() being done
first, since this is the mechanism to set up the new input focus,
and windowGainedFocus() is just updating the IME visibility state
after that is done.  However, by doing the startInput() first, that
means in the case where we are going to hide the IME we must first
wait for the IME to re-initialize editing on whatever input has
focus in the new window.

To address this, the change here tries to find a half-way point
between the two.  We now do startInput() after windowGainedFocus()
only when this will result in the window being hidden.

It is not as easy as that, though, because these are calls on to
the system service from the application.  So being able to do that
meant a fair amount of re-arranging of this part of the protocol
with the service.  Now windowGainedFocus() is called with all of
the information also needed for startInput(), and takes care of
performing both operations.  The client-side code is correspondingly
rearranged so that the guts of it where startInput() is called can
instead call the windowGainedFocus() entry if appropriate.

So...  in theory this is safer than the previous change, since it
should not be impacting the behavior as much.  In practice, however,
we are touching and re-arranging a lot more code, and "should" is
not a promise.

Change-Id: Icb58bef75ef4bf9979f3e2ba88cea20db2e2c3fb
2012-02-24 13:18:23 -08:00
Daniel Sandler
3f0c58eb70 Merge "New notification priority and related APIs." 2012-02-24 10:53:42 -08:00
Daniel Sandler
2561b0b10a New notification priority and related APIs.
This change introduces a few new bits of data on
Notification that will help the Notification Manager and
System UI route and display them more intelligently:

 -> priority: an integer in a predefined range that
    indicates the app's best guess as to the relative
    importance (to the user, right now) of that information

 -> kind: a tag (really, set of tags) indicating the general
    type of notification (realtime, asynchronous, etc)

 -> extras: a Bundle of additional key/value pairs
    associated with this notification (currently @hidden)

The notification manager takes these data into account when
assigning to each notification a score which is passed with
the notification on to the system UI, where it can be used to
affect presentation. For example:

  - Spammy apps (identified explicitly by the user or by
    some other means) will have their notifications scored
    very negatively by the notification manager, allowing
    the UI to suppress them
  - Notifications of higher score might be shown larger
    or in a different way
  - Very important notifications (indicated by a very high
    score) might interrupt the user during an otherwise
    important task (videochat, game, etc)

Implementation note: This replaces/extends the old internal
notion of "priority", which was mostly used to organize
ongoings and system notifications at the top of the panel.

Change-Id: Ie063dc75f198a68e2b5734a3aa0cacb5aba1ac39
2012-02-24 13:47:00 -05:00
Svetoslav Ganov
42d840b91d Merge "Fixing issues with the AccessibilityNodeInfo cache." 2012-02-23 19:04:41 -08:00
Svetoslav Ganov
57c7fd5a43 Fixing issues with the AccessibilityNodeInfo cache.
1. Before there were two caches one in the app process that
   kept track only the ids of infos that were given to a
   querying client and one in the querying client that
   holds the infos. This design requires precise sync
   between the caches. Doing that is somehow complicated
   since the app has cache for each window and it has
   to intercept all accessibility events from that window
   to manage the cache. Each app has to have a cache for
   each querying client. This approach would guarantee that
   no infos are fetched twice but due to its stateful nature
   and the two caches is tricky to implement and adds
   unnecessary complexity. Now there is only one cache in
   the client and the apps are stateless. The client is
   passing flags to the app that are a clue what nodes to
   prefetch. This approach may occasionally fetch a node
   twice but it is considerably simpler and stateless
   from the app perspective - there is only one cache.
   Fetching a node more than once does not cause much
   overhead compared to the IPC.

Change-Id: Ia02f6fe4f82cff9a9c2e21f4a36747de0f414c6f
2012-02-23 18:51:04 -08:00
Dianne Hackborn
e639da7baa New development permissions.
These are permissions that an application can request, but won't
normally be granted.  To have the permission granted, the user
must explicitly do so through a new "adb shell pm grant" command.

I put these permissions in the "development tools" permission
group.  Looking at the stuff there, I think all of the permissions
we already had in that group should be turned to development
permissions; I don't think any of them are protecting public APIs,
and they are really not things normal applications should use.

The support this, the protectionLevel of a permission has been
modified to consist of a base protection type with additional
flags.  The signatureOrSystem permission has thus been converted
to a signature base type with a new "system" flag; you can use
"system" and/or "dangerous" flags with signature permissions as
desired.

The permissions UI has been updated to understand these new types
of permissions and know when to display them.  Along with doing
that, it also now shows you which permissions are new when updating
an existing application.

This also starts laying the ground-work for "optional" permissions
(which development permissions are a certain specialized form of).
Completing that work requires some more features in the package
manager to understand generic optional permissions (having a
facility to not apply them when installing), along with the
appropriate UI for the app and user to manage those permissions.

Change-Id: I6571785c6bb5f6b291862b7a9be584885f88f3a5
2012-02-23 16:39:15 -08:00
Dianne Hackborn
b8678d76c3 resolved conflicts for merge of 210c1a26 to master
Change-Id: Ic44193e62215086c22225f2def5eee3159d26ae8
2012-02-23 10:54:06 -08:00
Craig Mautner
5489e4af19 Merge "- Consolidate all animations in a single place outside of layout loop. - Move mPolicy.startAnimationLw and mPolicy.finishAnimationLw into same method as mPolicy.animatingWindowLw. - Fix first parameter of performLayoutLockedInner(initial, ...) to pass true on initial pass." 2012-02-22 07:53:43 -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
Dianne Hackborn
01011c3d7c Fix issue #6037252: Screen shifts after all apps are upgraded
Two things: (1) make sure the boot message is always positioned within
the entire unrestricted display, and (2) allow the dim background to go
on top of the nav bar when being used for the boot message (this latter
is really a hack that should be more generally fixed in the future).

Change-Id: I7261b044eb802a39cadff931b50a679ff18781d6
2012-02-21 13:54:21 -08:00
Craig Mautner
2f995a7eaa - Consolidate all animations in a single place outside of layout loop.
- Move mPolicy.startAnimationLw and mPolicy.finishAnimationLw into same method as mPolicy.animatingWindowLw.
- Fix first parameter of performLayoutLockedInner(initial, ...) to pass true on initial pass.

Change-Id: If1b47bb8a7e03cf427769c657e371abc0910b3e3
2012-02-21 09:53:21 -08:00
Todd Poynor
94d0024557 Power HAL PowerManagerService hookup
Use PowerHAL to set system awake/suspend state.

Change-Id: If58a6f548564ea141b68f304455997d9ff04eace
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2012-02-17 22:19:45 -08:00
Jeff Brown
ba217ef207 Merge "Ignore broken input channel when finishing input event." 2012-02-17 10:30:50 -08:00
Jeff Brown
9806a2307f Ignore broken input channel when finishing input event.
There are occasional races during application shut down where the
input dispatcher will close an input channel before the application
has finished its last event.  So just ignore EPIPE.

Also tweak the logging for failed input event injection to make
it clearer which pid was trying to perform the injection.

Bug: 6013004
Change-Id: I7bbb01441d41762b03eafd4d39dcf0323e1cadf3
2012-02-17 10:28:09 -08:00
Dianne Hackborn
b9ee4f4425 Merge "Revert "Don't wait for current activity to pause before resuming next."" 2012-02-16 18:01:31 -08:00
Dianne Hackborn
621e2fecb5 Revert "Don't wait for current activity to pause before resuming next."
This reverts commit cbb722ed06092a9e2be37150aa8bc635f0fe21da.
2012-02-16 17:07:33 -08:00
Amith Yamasani
3c3155abea Merge "Fix Power Control widget" 2012-02-16 15:48:14 -08:00
Amith Yamasani
67cf7d314b Fix Power Control widget
Some changes in AppWidgetService were interfering with widget permissions.

Added some hidden methods in Context to communicate the requesting user
information instead of using the calling uid.

Bug: 6019296
Change-Id: I5e519fd3fbbfa5b3fcc5c297b729c671dac8e7c7
2012-02-16 15:03:42 -08:00
John Grossman
c157673a59 Add the CommonTimeManagementService.
Add a small service to the high level core set of system services to
control the configuration of the native common time service.  This
service is responsible for controlling policy regarding when the
common time service should be allowed to run, which networks it is
allowed to run on, what priority it runs at in the master election
algorithm, and so on.

Change-Id: I1fcd834c0286aea0df9557520693a3f42de59d69
Signed-off-by: John Grossman <johngro@google.com>
2012-02-16 13:45:10 -08:00
Svetoslav Ganov
cb46d80d21 Merge "Adding shell commands for modifying content." 2012-02-16 13:06:29 -08:00
Jeff Brown
4a06c8008b Simplify Choreographer API.
Removed the listeners and schedule animation / draw methods.
Instead all requests are posted as one-shot callbacks, which is a
better match for how clients actually use the Choreographer.

Bug: 5721047
Change-Id: I113180b2713a300e4444d0d987f52b8157b7ac15
2012-02-15 15:06:01 -08:00
Svetoslav Ganov
25872aa3ef Adding shell commands for modifying content.
1. Added methods to the ActivityManagerService remote interface
   that allow accessing content providers outside of an application.
   These methods are guarded by an internal signature protected
   permission which is given to the shell user. This enables a
   shell program to access content providers.

2. Implemented a shell command that takes as input as standart
   fagls with values and manipulates content via the content provider
   mechanism.

Change-Id: I2943f8b59fbab33eb623458fa01ea61a077b9845
2012-02-15 14:55:47 -08:00
Amith Yamasani
ea555e2740 Merge "Mixed up uid and user-id." 2012-02-14 16:12:27 -08:00
Amith Yamasani
c600e21ffc Mixed up uid and user-id.
1000 is not a userId !

Potential fix for #5990664,#6008692

Change-Id: I528e742e494bc24beef7b59ccb315b7a5d4e84fe
2012-02-14 16:08:07 -08:00
Mike Lockwood
ef9d55a6b0 am 8f7cc7af: am b9be8eff: am ffc89899: Merge "Don\'t pulse LED on new notification unless notification has LED flag set" into ics-mr1
* commit '8f7cc7af66520e3bd5e59e8eadb6907e3e043661':
  Don't pulse LED on new notification unless notification has LED flag set
2012-02-14 13:08:01 -08:00
Robert Greenwalt
2384386f31 Stop using shared DUN APN when tethering stops.
Backported from master, including a bug fix and a cdma enhancement.

Even if other people are sharing the connection (ie, carrier wants
default and tethered traffic on the same APN) stop using a carrier-
described APN when the tethering stops.

bug:5972599
Change-Id: I25e4831855e6b62c0c3ab3a6f4d4846aaee6ac50
2012-02-14 11:44:09 -08:00
Mike Lockwood
ece18efb35 Don't pulse LED on new notification unless notification has LED flag set
Bug: 6006131

Change-Id: I719c7d68e310bfaca227f6286159b3993784926b
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-13 20:42:19 -08:00
Dianne Hackborn
07f941f026 Merge "Move BroadcastQueue out of the ActivityManager class." 2012-02-13 14:34:26 -08:00
Dianne Hackborn
ec5b5156e7 Merge "Fix issue where screen rotations would stop animating." 2012-02-13 13:30:53 -08:00