summaryrefslogtreecommitdiffstats
path: root/services/java
Commit message (Collapse)AuthorAgeFilesLines
* am fcfc99c0: am f7918b4a: am d3a57029: am 1b0c9c95: am 81c1d8d3: Ensure ↵Christopher Tate2013-05-061-1/+10
|\ | | | | | | | | | | | | install-during-restore is like install-then-restore * commit 'fcfc99c064f0b91fa419784bd90bb9944b9ab9f4': Ensure install-during-restore is like install-then-restore
| * am d3a57029: am 1b0c9c95: am 81c1d8d3: Ensure install-during-restore is like ↵Christopher Tate2013-05-061-1/+10
| |\ | | | | | | | | | | | | | | | | | | install-then-restore * commit 'd3a57029e80073aa3c7dfe1dbc8945d32968f6ae': Ensure install-during-restore is like install-then-restore
| | * am 1b0c9c95: am 81c1d8d3: Ensure install-during-restore is like ↵Christopher Tate2013-05-061-1/+10
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | install-then-restore * commit '1b0c9c95dc72ebeb8af73bc3ff44c313ebd788f4': Ensure install-during-restore is like install-then-restore
| | | * am 81c1d8d3: Ensure install-during-restore is like install-then-restoreChristopher Tate2013-05-061-1/+10
| | | |\ | | | | | | | | | | | | | | | | | | | | * commit '81c1d8d3a5aef6a423f0bb02de1b362b2f2d12df': Ensure install-during-restore is like install-then-restore
| | | | * Ensure install-during-restore is like install-then-restoreChristopher Tate2013-05-061-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we've installed an apk from the archive, recheck whether to apply the system-uid policy restrictions around file system restores. Bug 8833099 (cherry picked from commit 2baf6dcfcf7fc1705db25e64dc0cb11fa3509d39) Change-Id: I972fe1543f2234aa76baf562d6f806175ac0248e
| | | * | am 64d1f3ef: DO NOT MERGE - Full (local) restore security changesChristopher Tate2012-09-281-20/+43
| | | |\ \ | | | | |/ | | | | | | | | | | | | | | | * commit '64d1f3efd759b70462aecb6cf1d8c733872a8911': DO NOT MERGE - Full (local) restore security changes
| | | | * DO NOT MERGE - Full (local) restore security changesChristopher Tate2012-09-271-20/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) Prevent full restore from creating files/directories that are accessible by other applications (2) Don't restore filesets from "system" packages; i.e. any that runs as a special uid, unless they define their own agent for handling the restore process. Bug 7168284 This is a cherry-pick from the originating tree. Change-Id: I9f39ada3c4c3b7ee63330b015e62745e84ccb58f
| | * | | Notification vibration improvements: [DO NOT MERGE]Daniel Sandler2012-11-191-8/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When notifications vibrate as a fallback (that is, because they want to play a sound but the device is in vibrate mode), this no longer requires the VIBRATE permission. - As a bonus, if your notifications use DEFAULT_VIBRATE, you don't need the VIBRATE permission either. - If you specify a custom vibration pattern, you'll still need the VIBRATE permission for that. - Notifications vibrating in fallback mode use same vibration pattern but can be changed easily in future. - The DEFAULT_VIBRATE and fallback vibrate patterns are now specified in config.xml. Bug: 7531442 Change-Id: I7a2d8413d1becc53b9d31f0d1abbc2acc3f650c6
| | * | | When in vibrate mode, all notifications will vibrate.David Agnew2012-11-101-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Unless the notification specifies no ringtone AND no vibration, in which case it will remain silent.) Bug: 7516358 Change-Id: I926d0fe0165b9622cd117e6c3ef6e3637772b444
* | | | | am 596532d9: Properly initialize recognition service if the recognizer ↵Amith Yamasani2013-01-221-7/+5
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | component changed. * commit '596532d9dbea3460dbc989b0316c721ca69f4915': Properly initialize recognition service if the recognizer component changed.
| * | | | Properly initialize recognition service if the recognizer component changed.Amith Yamasani2013-01-221-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The getServiceInfo() call directly to IPackageManager does not throw an exception. The return value needed to be checked for null. Bug: 8031032 Change-Id: I701b9e8cf3b2406a3b35a486183330489b3d46f5
| * | | | DO NOT MERGE Prevent OOM death for services under ServiceWatcher's care.Victoria Lease2013-01-161-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If87be5769b55368edaf4776189e8f6e51a21eb03 Conflicts: services/java/com/android/server/ServiceWatcher.java
* | | | Merge "Revert "Fix a bug where disabled auxilialy IME is unexpectedly ↵Satoshi Kataoka2013-01-101-9/+0
|\ \ \ \ | | | | | | | | | | | | | | | re-enabled"" into jb-mr1.1-dev
| * | | | Revert "Fix a bug where disabled auxilialy IME is unexpectedly re-enabled"Satoshi Kataoka2013-01-101-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 32b812054cce27d1c70b53ba8ac729c7186b105e Bug: 7976890 Change-Id: I75ab60734153719b199cf7281d23f5eb1ad2d1bc
* | | | | Merge "Improve heuristics for detecting wireless chargers." into jb-mr1.1-devSascha Prueter2013-01-103-40/+355
|\ \ \ \ \
| * | | | | Improve heuristics for detecting wireless chargers.Jeff Brown2013-01-103-40/+355
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some devices, we need to apply heuristics to determine whether the device is docked on a wireless charger because the charging circuits do not provide sufficient information to know whether the device is on the charger unless it is actually receiving power. The previous heuristics only considered the battery level to suppress spurious dock signals. The new heuristics also take into account whether the device appears to have moved from its previous position on the dock. Bug: 7744185 Change-Id: I5ba885dac25b37840b6db46b8a0f30968a06776c
* | | | | Merge from master: fix issue #7966357: Super lights out mode vs. volume dialogDianne Hackborn2013-01-091-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | The volume panel now forces us out of the UI modes while it is up. Change-Id: If39fa33b1c52579bf5d376ce4722408cee3ca951
* | | | Fix a bug where disabled auxilialy IME is unexpectedly re-enabledsatok2012-12-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 7872918 This is a serious issue which the disabled system auxilialy IME is unexpectedly re-enabled by re-building internal IMI cache. Change-Id: I0727cc973dfaea9823194021ce94af8665b98373
* | | | Fade recents thumbnail to transparent earlier.Craig Mautner2012-12-171-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce the gpu load by fading the recents thumbnail to an alpha of 0.0 before the remaining animations are completed. When alpha hits 0 the gpu treats the layer as hidden and can merge the remaining layers in time. This is a partial fix for 7729214. Change-Id: I9761bbd0554db6454c7eec0485be798b11672ff5
* | | | Fix NPE inside DreamManagerService.John Spurlock2012-12-141-0/+3
| | | | | | | | | | | | | | | | | | | | Bug:7741911 Change-Id: Icfc39b2d89f57bba79866030df85b822e3f73ae2
* | | | Merge "If freeCache deletes APK, give out of space error" into jb-mr1.1-devKenny Root2012-12-111-0/+12
|\ \ \ \
| * | | | If freeCache deletes APK, give out of space errorKenny Root2012-12-111-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After DownloadManager has downloaded an application to cache to install during low memory condition, we try to free cache to fit the new application. The free cache function deletes older files first, but it will also delete the downloaded application (since it's in cache) as a last resort since installd has no context about it. This just changes the error code returned in this case so that we'll give something more meaningful to the user. A later fix should actually make this more sane. For instance: know which file to avoid deleting, not even trying to delete anything if it won't arrive at the desired free space. Bug: 7684538 Change-Id: Ide77320fc51a4f692ef8042cb0eafe17b5cd279d
* | | | | Merge "Play a tone when wireless charging begins." into jb-mr1.1-devJeff Brown2012-12-112-0/+51
|\ \ \ \ \
| * | | | | Play a tone when wireless charging begins.Jeff Brown2012-12-112-0/+51
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only plays a tone if the battery level is below 95% which is the same heuristic used when determining whether to turn the screen on. Use new low battery and wireless charging sounds on Mako. Bug: 7371658 Change-Id: Ia4527ec398d024ee418a4287e1fcbf0ec83bcc24
* | | | | Fallback to default dream if the current dream is removed.John Spurlock2012-12-101-1/+34
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To minimize fix size, return only valid dreams from the service api. Settings will "just work" with no changes. Bug:7699398 Change-Id: I3eb88237a8ccc421fdb68d1de19820614b13d7b8
* | | | Call setSize to sync Surface to SurfaceFlinger. DO NOT MERGECraig Mautner2012-12-072-39/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RecentsActivity screenshots are called for very quickly after WindowStateAnimator prepareSurface(). Without enough delay the Surface.setLayer call does not propagate to the SurfaceFlinger and the screenshot is incorrect (black) because it stops sampling the layers too early. This fix calls Surface.setSize() for each sampled Surface in screenshots. setSize forces the SurfaceFlinger to process all transactions queued before returning from closeTransaction. Bug 7552304 fixed. Change-Id: I1911dfa0b09cab713c55f5ba0c612496337a77df Conflicts: services/java/com/android/server/wm/WindowManagerService.java
* | | | Merge "DO NOT MERGE Adjust update interval when expiring location requests." ↵Victoria Lease2012-12-051-3/+0
|\ \ \ \ | | | | | | | | | | | | | | | into jb-mr1.1-dev
| * | | | DO NOT MERGE Adjust update interval when expiring location requests.Victoria Lease2012-12-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cherry-pick I88b419c92940b7e536d48b26e5fc0f72f3c9e73d This is a more complete solution for this issue that disables location providers when expiring their last request *and* adjusts update intervals when expiring any request. This should help further limit battery drain when a high-frequency-update app exits, as it allows the system to throttle the update interval back down to something appropriate for the remaining listeners. Bug: 7611837 Change-Id: I7629a90f4c693be4bf96d662bd3a8b06dae0b089
* | | | | Merge "Pin electron beam surface to natural orientation." into jb-mr1.1-devJeff Brown2012-12-045-43/+143
|\ \ \ \ \
| * | | | | Pin electron beam surface to natural orientation.Jeff Brown2012-12-045-43/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a rotation occurred while the electron beam surface was showing, the surface may have appeared in the wrong orientation. We fix this problem by adjusting the transformation matrix of the electron beam surface according to the display orientation whenever a display transaction occurs. The rotation itself is allowed to proceed but it is not visible to the user. We must let this happen so that the lock screen is correctly oriented when the screen is turned back on. Note that the electron beam surface serves two purposes. First, it is used to play the screen off animation. When the animation is finished, the surface remains visible but is solid black. Then we turn the screen off. Second, when we turn the screen back on we leave the electron beam surface showing until the window manager is ready to show the new content. This prevents the user from seeing a flash of the old content while the screen is being turned on. When everything is ready, we dismiss the electron beam. It's important for the electron beam to remain visible for the entire duration from just before the screen is turned off until after the screen is turned on and is ready to be seen. This is why we cannot fix the bug by deferring rotation or otherwise getting in the way of the window manager doing what it needs to do to get the screen ready when the screen is turned on again. Bug: 7479740 Change-Id: I2fcf35114ad9b2e00fdfc67793be6df62c8dc4c3
* | | | | | Merge "Fix an issue on installing 3rd-party IME by a non-primary user" into ↵satok2012-12-041-2/+4
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | jb-mr1.1-dev
| * | | | | Fix an issue on installing 3rd-party IME by a non-primary usersatok2012-12-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 7573552 Currently IMMS doesn't receive install/uninstall messages. Accordingly enabled IMEs' list is not refreshed properly. Change-Id: I25e9798a65f528dd270cd6bb1f14b1d887194787
* | | | | | DO NOT MERGE Notify provider when disposing last UpdateRecordVictoria Lease2012-12-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cherry-pick of Id48151eb7de40164258cde7da220a4d6bb34b89a Location providers were not being notified of the change in status when the last UpdateRecord was removed due to numUpdates exhaustion or request expiry. Oops! Enjoy some free battery life! Bug: 7611837 Change-Id: I66303b355be4e4a56a81efb5406c9353b2588595
* | | | | | Merge "PRIORITY_MIN notifications should be truly ambient." into jb-mr1.1-devSascha Prueter2012-12-041-2/+13
|\ \ \ \ \ \
| * | | | | | PRIORITY_MIN notifications should be truly ambient.Daniel Sandler2012-12-041-2/+13
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If your notification is set to MIN priority, it will never attempt to interrupt the user, either by an icon (already implemented), or (new in this patch) by LED, vibration, or sound. Bug: 7648785 Change-Id: Ia0f8e010e62029d8d8ef1955dd20b7c79fb68398
* | | | | | Merge "Kill dreams that do not create a timely service connection." into ↵John Spurlock2012-12-041-0/+18
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | jb-mr1.1-dev
| * | | | | | Kill dreams that do not create a timely service connection.John Spurlock2012-12-041-0/+18
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a timeout between when the dream binds and when the dream creates the service connection. If the connection is not created within a certain amount of time, stop the dream. This fixes the current bug where a dream that crashes in onCreate (or the ctor) can put the dream controller in a bad state until the screen is turned off. The timeout is equal to the service restart delay in activity manager (ActiveServices) to avoid restarting (and recrashing). Bug:7596707 Change-Id: I3e11efc6af0b79ec4cb0fbc94e4e109c7602ddac
* | | | | | Change getName and getAddress permission to BLUETOOTHMatthew Xie2012-12-041-4/+4
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The permissions were set as BLUETOOTH_ADMIN by mistake. Correct them bug 7665249 Change-Id: Ic1bdbeb25e8f55d886f9a8d38920cbb769dd38ca
* | | | | Merge "Fix issue #7649590: Background windows sometimes not being hidden for ↵Dianne Hackborn2012-12-037-42/+67
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | secondary users" into jb-mr1.1-dev
| * | | | | Fix issue #7649590: Background windows sometimes not being hidden for ↵Dianne Hackborn2012-12-037-42/+67
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | secondary users There are two things going on here: (1) In secondary users, some times theme information such as whether the window is full screen opaque was not being retrieved, so the window manager didn't know that it could hide the windows behind the app. This would just be a performance problem, except that: (2) There appear to be a number of applications that declare that they are full screen opaque, when in fact they are not. Instead they are using window surfaces with an alpha channel, and setting some pixels in their window to a non-opaque alpha level. This will allow you to see whatever is behind the app. If the system happens to completely remove the windows behind the app, and somebody is filling the frame buffer with black, then you will see what the app intends -- those parts of its UI blended with black. If one of those cases doesn't hold (and though we have never guaranteed they would, in practice this is generally what happens), then you will see something else. At any rate, if nothing else than for performance reasons, we need to fix issue #1. It turns out what is happening here is that the AttributeCache used by the activity manager and window manager to retreive theme and other information about applications has not yet been updated for multi-user. One of the things we retrieve from this is the theme information telling the window manager whether an application's window should be treated as full screen opaque, allowing it to hide any windows behind it. In the current implementation, the AttributeCache always retrieves this information about the application as the primary user (user 0). So, if you have an application that is installed on a secondary user but not installed on the primary user, when the AttributeCache tries to retrieve the requested information for it, then from the perspective of the primary user it considers the application not installed, and is not able to retrieve that info. The change here makes AttributeCache multi-user aware, keeping all of its data separately per-user, and requiring that callers now provide the user they want to retrieve information for. Activity manager and window manager are updated to be able to pass in the user when needed. This required some fiddling of the window manager to have that information available -- in particular it needs to be associated with the AppWindowToken. Change-Id: I4b50b4b3a41bab9d4689e61f3584778e451343c8
* | | | | Merge "BT is still on after enable flight mode, and reboot the DUT" into ↵Zhihai Xu2012-12-031-65/+112
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | jb-mr1.1-dev
| * | | | | BT is still on after enable flight mode, and reboot the DUTZhihai Xu2012-12-031-65/+112
| |/ / / / | | | | | | | | | | | | | | | | | | | | bug 7275625 Change-Id: I4f8952a06152eb5f5775c1f616f6383e4f20e352
* | | | | Merge "Avoid null mobile interfaces." into jb-mr1.1-devJeff Sharkey2012-12-031-1/+1
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Avoid null mobile interfaces.Jeff Sharkey2012-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Bug: 7634215 Change-Id: I6745f6a78c07ba11d98b4562a6b53386112ef652
* | | | | Fix crosstalk between users for widgets hosted in lockscreenAmith Yamasani2012-11-302-29/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was initially about the Clock widget crashing repeatedly on some devices with multiple users. Turned out that there were race conditions when switching users that could result in remote views of one user calling back to the RemoteViewsAdapter in keyguard that in turn sent an incorrect widget id to a different user's widget, resulting in a crash. Since KeyguardHostView is instantiated in the same process for different users, it needs to carry a user identity to pass along to AppWidgetService so that remote views services were bound to the correct user and callbacks were attached and detached properly. Added some aidl calls that take the userId to do the binding properly. A more complete fix might be needed in the future so that all calls from Keyguard carry the user id. Also, there was a problem in comparing host uid for secondary users, since Settings for a secondary user has a different uid than keyguard. Not an issue on single-user systems. Changed the host.uid comparison to accomodate for the secondary user. Bug: 7450247 Change-Id: Idbc36e3c60023cac74174f6cb7f2b2130dd3052c
* | | | | Include child windows when looking for insertion point.Craig Mautner2012-11-303-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After finding a window in the window list we turn around and look in the AppWindowToken.windows list for it. If it is a child of a window in that list we should use the parent windows index as the search result. Instead we gave up and ended up inserting the window at the beginning of the windows list. Bug 7357465 fixed. Change-Id: If77f343b8597bfbb0b7fa41dedf7972d78d03020
* | | | | Merge "Allow the NFC process to call Bluetooth APIs." into jb-mr1.1-devMartijn Coenen2012-11-301-4/+8
|\ \ \ \ \
| * | | | | Allow the NFC process to call Bluetooth APIs.Martijn Coenen2012-11-291-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NFC process used to be only running as user 0, and it may be calling into Bluetooth. Most of the handover code has now moved to a separate process running as the current user. Fix the existing checks to take into account the correct NFC UID, whatever user it is running as. Bug: 7309141 Change-Id: I953cfb263a28aef7fe1be5880b053425dc359a29
* | | | | | Merge "Maybe fix issue #7596986: Frequent runtime restarts; IAE at..." into ↵Dianne Hackborn2012-11-302-3/+19
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | jb-mr1.1-dev
| * | | | | | Maybe fix issue #7596986: Frequent runtime restarts; IAE at...Dianne Hackborn2012-11-292-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...android.os.Parcel.nativeAppendFrom(Native Method) The failing stack trace is: 11-20 20:29:04.365 19154 19170 E AndroidRuntime: java.lang.IllegalArgumentException 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.nativeAppendFrom(Native Method) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.appendFrom(Parcel.java:428) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Bundle.writeToParcel(Bundle.java:1613) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.writeBundle(Parcel.java:605) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.location.Location.writeToParcel(Location.java:903) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.writeParcelable(Parcel.java:1254) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.writeValue(Parcel.java:1173) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.writeMapInternal(Parcel.java:591) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Bundle.writeToParcel(Bundle.java:1619) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.writeBundle(Parcel.java:605) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.location.Location.writeToParcel(Location.java:903) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.writeParcelable(Parcel.java:1254) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.writeValue(Parcel.java:1173) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.writeMapInternal(Parcel.java:591) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Bundle.writeToParcel(Bundle.java:1619) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.os.Parcel.writeBundle(Parcel.java:605) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.content.Intent.writeToParcel(Intent.java:6660) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at android.app.ApplicationThreadProxy.scheduleReceiver(ApplicationThreadNative.java:763) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at com.android.server.am.BroadcastQueue.processCurBroadcastLocked(BroadcastQueue.java:230) 11-20 20:29:04.365 19154 19170 E AndroidRuntime: at com.android.server.am.BroadcastQueue.processNextBroadcast(BroadcastQueue.java:777) This is odd because where we do Bundle.writeToParcel(), we are just writing the Parcel we have with its current length. There is no way this should be able to fail like this... unless the Bundle is changed while we are running? Hm. It looks like the location manager is holding on to Location objects which have a Bundle of extras. It is that Bundle of extras that the crash is happening on. And the bundle extras can be changed as it operates. And there are places where the raw Location object is returned from the location manager, which means the caller can be olding on to a Location object whose extras can be changed at any time by other threads in the location manager. So that seem suspicious. This change should take care of all these places in the location manager, by making sure to copy the location object before it goes out of the location manager. In addition, add some code to the activity manager to not bring down the entire system if there is a problem trying to send one of these broadcasts. There is no need, we can just skip the broadcast as bad. Change-Id: I3043c1e06f9d2931a367f831b6a970d71b0d0621