summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/am
Commit message (Collapse)AuthorAgeFilesLines
* Move some system services to separate directoriesAmith Yamasani2013-12-1946-37208/+0
| | | | | | | | Refactored the directory structure so that services can be optionally excluded. This is step 1. Will be followed by another change that makes it possible to remove services from the build. Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
* Merge "Pair ActivityStacks with Displays" into klp-modular-devCraig Mautner2013-12-194-405/+692
|\
| * Pair ActivityStacks with DisplaysCraig Mautner2013-12-184-405/+692
| | | | | | | | | | | | | | | | | | | | | | | | | | - Introduce concept of ActivityStacks residing on Displays and able to be decoupled and moved around. - Add a new interface, IActivityContainer for clients to handle ActivityStacks. - Abandon ordering of stacks based on mStackState and instead use ActivityDisplayInfo.stacks<ActivityStack> ordering. Progress towards closing bug 12078972. Change-Id: I7785b61c26dc17f432a4803eebee07c7415fcc1f
* | am 46f618a7: am a8dfd5d8: am 4dcf1af3: am cccf2a33: Merge "Keydispatching ↵Craig Mautner2013-12-191-0/+1
|\ \ | | | | | | | | | | | | | | | | | | timeout while finish Activity" * commit '46f618a7d9dde8e668666e0c582d88ddfea759d9': Keydispatching timeout while finish Activity
| * \ am 4dcf1af3: am cccf2a33: Merge "Keydispatching timeout while finish Activity"Craig Mautner2013-12-191-0/+1
| |\ \ | | | | | | | | | | | | | | | | * commit '4dcf1af3ed8dfa546e6cbf5ecfa66914a3fda883': Keydispatching timeout while finish Activity
| | * | Keydispatching timeout while finish ActivityMartin Wallgren2013-12-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is input to be handled during finish activity we can get a keydispatching timeout ANR. The reason is that finish activity is some times not possible, and the activity is instead put on a finish queue. The activity will then be finished sometime in the future. When we add the activity to the finish queue, key dispatching is paused, and there is an ANR timer waiting for it to be resumed again. Since it can take a long time before the activity is actually finished, we need to resume the key dispatching to avoid the ANR. Change-Id: Icea4ab3b5ad05c8bfbadf8f5cece1a59ec621469
* | | | Fix loop limits.Craig Mautner2013-12-181-1/+1
| |_|/ |/| | | | | | | | | | | | | | Fixes bug 12207606. Change-Id: I9b450d2bc2a72a1f6581147f8930188f34c85299
* | | am 38bcf6dc: am 422d7003: am f431daa2: Merge "Fix to NullPointerException on ↵Craig Mautner2013-12-171-3/+1
|\| | | | | | | | | | | | | | | | | | | | move back in ActivityStack." * commit '38bcf6dc8784625eb4b68634450c578719346669': Fix to NullPointerException on move back in ActivityStack.
| * | am f431daa2: Merge "Fix to NullPointerException on move back in ActivityStack."Craig Mautner2013-12-171-3/+1
| |\| | | | | | | | | | | | | * commit 'f431daa22811fdce9c4ec975d5d33121898b4f9b': Fix to NullPointerException on move back in ActivityStack.
| | * Fix to NullPointerException on move back in ActivityStack.Daniel 2 Olofsson2013-12-171-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In ActivityTask.moveTaskToBackLocked NullPointerException may occur when moving back with only current Activity in stack. This due to a condition that may trigger despite a TaskRecord being null and then attempt accessing the TaskRecord.mOnTopOfHome variable. TaskRecord task may be set to null when no resumed activity remain. Resolved by assuring that flag mOnTopOfHome is instead set to false for current TaskRecord in case where there are no remaining activities above home. The above bug has already been corrected in the following commit, ada62fca51d314cefe2c5da4e007df5b9abf320d, but it does not set the cottect value to mTopOfHome for the current taks, see below. Variable mOnTopOfHome will not be set to false in situations where stack is of size 1 or less and task is null, perhaps from already having finished current activity. To avoid current TaskRecord maintaining value mOnTopOfHome to true after launching Home this variable is set to false. Impact should not be major due to correction earlier that makes sure that there is always a TaskRecord.mOnTopOfHome set to true above Home activity but if not correctly set for current task still gives a possibility of bad behavior. Change-Id: Ie86ad99c188aaa05b0de9d58eaa16c42b6fc4341
* | | Fix incorrect setting of TaskRecord.frontOfTask DO NOT MERGECraig Mautner2013-12-162-21/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Intent.FLAG_ACTIVITY_REORDER_TO_FRONT was set the TaskRecord member frontOfTask was being set true incorrectly for the top activity. It should only be true for the bottom activity. This fix ensures that frontOfTask is always set correctly for all activities by consoldating it into one method. Fixes bug 12171535. Change-Id: If982dad3c81b2b816adc5d89e7e0496923098a70
* | | am 31b9ec01: am 62d509d2: am 37c69fdd: Merge "Use java.util.Objects instead ↵Kenny Root2013-12-131-2/+2
|\| | | | | | | | | | | | | | | | | | | | on internal API" * commit '31b9ec01ff6087773cb35af6824a6422a0181afb': Use java.util.Objects instead on internal API
| * | am 37c69fdd: Merge "Use java.util.Objects instead on internal API"Kenny Root2013-12-131-2/+2
| |\| | | | | | | | | | | | | * commit '37c69fdd826f3973966430adc1abfbefc19bc16e': Use java.util.Objects instead on internal API
| | * Use java.util.Objects instead on internal APIKenny Root2013-12-131-2/+2
| | | | | | | | | | | | | | | | | | | | | Not needed since java.util.Objects implements all the needed functionality. Change-Id: Icd31d49a9801d1705427f028e9ac927d58e7d34c
* | | Introduce a Lifecycle for system servicesAdam Lesinski2013-12-121-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide an abstract class for system services to extend from, similar to the android.app.Service. This will allow services to receive events in a uniform way, and will allow services to be created and started in the correct order regardless of whether or not a particular service exists. Similar to android.app.Service, services are meant to implement Binder interfaces as inner classes. This prevents services from having incestuous access to each other and makes them use the public API. Change-Id: Iaacfee8d5f080a28d7cc606761f4624673ed390f
* | | DO NOT MERGE: Eliminate StackBox.Craig Mautner2013-12-092-76/+55
| | | | | | | | | | | | | | | | | | | | | | | | StackBox is too constraining. Adding size and position to TaskStacks directly makes stack positioning and management more flexible and prepares for ActivityView. Change-Id: I33c6b4e1c23a5a8069fd507c160bcb34e4d287b2
* | | DO NOT MERGE: Remove obsolete "headless" supportMike Lockwood2013-12-092-24/+3
|/ / | | | | | | Change-Id: I829fe48e6ebcb819e260646bb19ac6ddfcf07f83
* | am 2c082ae3: am 90e9b1d3: Fix issue #11790471: Crash removed home buttons ↵Dianne Hackborn2013-11-211-3/+5
|\ \ | |/ |/| | | | | | | | | and notification bar/shade * commit '2c082ae3d209aa590c1839d75436f7aa77b37125': Fix issue #11790471: Crash removed home buttons and notification bar/shade
| * Fix issue #11790471: Crash removed home buttons and notification bar/shadeDianne Hackborn2013-11-211-3/+5
| | | | | | | | | | | | | | Whoops persistent processes are, well, persistent. Don't remove services from them. We'll be keeping that process record around. Change-Id: I29e9fb6f704efdf0caad5e0307a7adbb416eed3b
* | am 1abead42: am 245408d2: Merge "Do not hold direct ref BatteryStatsImpl" ↵Adam Lesinski2013-11-182-12/+10
|\| | | | | | | | | | | | | into klp-dev * commit '1abead425c0e862e316e17521833a33d22e7a850': Do not hold direct ref BatteryStatsImpl$Uid$Proc
| * Merge "Do not hold direct ref BatteryStatsImpl$Uid$Proc" into klp-devAdam Lesinski2013-11-182-12/+10
| |\
| | * Do not hold direct ref BatteryStatsImpl$Uid$ProcAdam Lesinski2013-11-182-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BatteryStatsImpl can reset its collected data, including removing a BatteryStatsImpl$Uid$Proc object. If a ProcessRecord has a direct reference, then the battery stats for a process will be recorded in an old Proc object and prevent GC, causing a memory leak. bug:11087238 Change-Id: I19a9cd9d8361c10446a8ebdd5c0860b56c442209
* | | am 6e5cf573: am 99437f25: Merge "Ensure recipient can be launched before ↵Christopher Tate2013-11-141-0/+21
|\| | | | | | | | | | | | | | | | | | | | attempting broadcast delivery" into klp-dev * commit '6e5cf573f2f2e17825af2973daeba893c6aa5855': Ensure recipient can be launched before attempting broadcast delivery
| * | Merge "Ensure recipient can be launched before attempting broadcast ↵Christopher Tate2013-11-141-0/+21
| |\ \ | | | | | | | | | | | | delivery" into klp-dev
| | * | Ensure recipient can be launched before attempting broadcast deliveryChristopher Tate2013-11-141-0/+21
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User removal or eviction inherently races with broadcast delivery. This patch introduces a latest-possible recheck of the availbility of the target application before attempting to send it a broadcast. Once the process has actually been spun up the system is essentially committed to presenting it as a running application, and there is no later check of the availability of the app: the failure mode for continuing to attempt delivery is a crash *in the app process*, and is user-visible. We now check the app+userid existence of the intended recipient just prior to committing to launch its process for receipt, and if it is no longer available we simply skip that receiver and continue normally. Bug 11652784 Bug 11272019 Bug 8263020 Change-Id: Ib19ba2af493250890db7371c1a9f853772db1af0
* | | am 59bf3be7: am 2e3ede74: Merge "Maybe fix issue #11634365: Leaking ↵Dianne Hackborn2013-11-141-1/+20
|\| | | | | | | | | | | | | | | | | | | | restarting services" into klp-dev * commit '59bf3be7d1cd7311cf60ead6872f33433a097bd1': Maybe fix issue #11634365: Leaking restarting services
| * | Merge "Maybe fix issue #11634365: Leaking restarting services" into klp-devDianne Hackborn2013-11-141-1/+20
| |\ \
| | * | Maybe fix issue #11634365: Leaking restarting servicesDianne Hackborn2013-11-141-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It looks like we could add services to the restart list because they end up left in the process's list of running services after they have been removed from the main activity list, and we can trip up on them there when the app is being force stopped. Change-Id: I79805b67fcf5b593430dc5c856c97927e1a54a57
* | | | am 29bbd570: am 1f0f9fa9: Merge "Add null pointer check." into klp-devCraig Mautner2013-11-131-1/+3
|\| | | | | | | | | | | | | | | | | | | * commit '29bbd570fe36c55321a3cd9d84330dea9d2f1e10': Add null pointer check.
| * | | Merge "Add null pointer check." into klp-devCraig Mautner2013-11-141-1/+3
| |\ \ \ | | |_|/ | |/| |
| | * | Add null pointer check.Craig Mautner2013-11-131-1/+3
| | |/ | | | | | | | | | | | | | | | Fixes bug 11673948. Change-Id: I60b590b9793ae1b8d5c3d343f4bb6cb40ba4a092
* | | am 679ba4e8: am 6cd206b2: Merge "Relayout windows that handle their own ↵Craig Mautner2013-11-121-3/+5
|\| | | | | | | | | | | | | | | | | | | | config change." into klp-dev * commit '679ba4e86e4fecb6dbfe48d6c49205c32f995a1c': Relayout windows that handle their own config change.
| * | Relayout windows that handle their own config change.Craig Mautner2013-11-121-3/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a window claims to handle its own configuration change then we won't destroy and recreate its window on a configuration change. Normally that recreation triggers the first layout following orientation change because mHaveFrame is false. Windows that handle their own configuration changes never got a relayout pass following a change in orientation. This change passes the configuration changes that an application handles into the AppWindowToken. If the app says it handles orientation or screen size changes then a relayout will occur when the configuration has changed. Fixes bug 11647107. Change-Id: Ie8d49fd050442ebbdcf0b805087894e3a2fc4be9
* | am 0259c010: am 596e409e: Merge "Work on issue #11634365: Leaking restarting ↵Dianne Hackborn2013-11-112-24/+45
|\| | | | | | | | | | | | | services" into klp-dev * commit '0259c010221c73db11ee52b4b0758a179e5c0db1': Work on issue #11634365: Leaking restarting services
| * Work on issue #11634365: Leaking restarting servicesDianne Hackborn2013-11-112-24/+45
| | | | | | | | | | | | | | | | | | Tighten up some flows to try to avoid any chance of leaving a restarting service on the list, add a log to the only remaining place I could find that we could get in to trouble for some reason. Change-Id: Iffb9be9d97deefc6cf0c5790eedfeb6e4e8a36bc
* | am 7e40e317: am c85a1143: Merge "Fix issue #11630188: Still seeing some ↵Dianne Hackborn2013-11-111-0/+2
|\| | | | | | | | | | | | | processes not on LRU list errors" into klp-dev * commit '7e40e3176399e0609051e5f0bfcb5149e78c2ea6': Fix issue #11630188: Still seeing some processes not on LRU list errors
| * Fix issue #11630188: Still seeing some processes not on LRU list errorsDianne Hackborn2013-11-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This happened: android.util.Log$TerribleFailure: Adding dependent process ProcessRecord{43c7a120 0:com.google.android.gms/u0a7} not on LRU list: service connection ConnectionRecord{437c16e0 u0 CR ACT com.google.android.gms/.icing.impl.IndexService:@436ba7f8} from ProcessRecord{43c64208 4908:com.google.android.googlequicksearchbox:search/u0a19} at android.util.Log.wtf(Log.java:290) at android.util.Slog.wtf(Slog.java:82) at com.android.server.am.ActivityManagerService.updateLruProcessInternalLocked(ActivityManagerService.java:2290) at com.android.server.am.ActivityManagerService.updateLruProcessLocked(ActivityManagerService.java:2508) at com.android.server.am.ActiveServices.updateServiceClientActivitiesLocked(ActiveServices.java:636) at com.android.server.am.ActiveServices.removeConnectionLocked(ActiveServices.java:1656) at com.android.server.am.ActiveServices.unbindServiceLocked(ActiveServices.java:860) at com.android.server.am.ActivityManagerService.unbindService(ActivityManagerService.java:12773) at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:869) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2071) at android.os.Binder.execTransact(Binder.java:404) at dalvik.system.NativeStart.run(Native Method) Because of this earlier: 11-09 18:02:19.126 W/ActivityManager( 809): Exception when starting service com.google.android.gms/.icing.impl.IndexService 11-09 18:02:19.126 W/ActivityManager( 809): android.os.DeadObjectException 11-09 18:02:19.126 W/ActivityManager( 809): at android.os.BinderProxy.transact(Native Method) 11-09 18:02:19.126 W/ActivityManager( 809): at android.app.ApplicationThreadProxy.scheduleCreateService(ApplicationThreadNative.java:850) 11-09 18:02:19.126 W/ActivityManager( 809): at com.android.server.am.ActiveServices.realStartServiceLocked(ActiveServices.java:1384) 11-09 18:02:19.126 W/ActivityManager( 809): at com.android.server.am.ActiveServices.bringUpServiceLocked(ActiveServices.java:1294) 11-09 18:02:19.126 W/ActivityManager( 809): at com.android.server.am.ActiveServices.bindServiceLocked(ActiveServices.java:755) 11-09 18:02:19.126 W/ActivityManager( 809): at com.android.server.am.ActivityManagerService.bindService(ActivityManagerService.java:12766) 11-09 18:02:19.126 W/ActivityManager( 809): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:859) 11-09 18:02:19.126 W/ActivityManager( 809): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2071) 11-09 18:02:19.126 W/ActivityManager( 809): at android.os.Binder.execTransact(Binder.java:404) 11-09 18:02:19.126 W/ActivityManager( 809): at dalvik.system.NativeStart.run(Native Method) Not clearing the service's app pointer. Also fix this wtf where we were not clearing the started state of a ServiceTracker when its process goes away. (This was like this because we used to want to leave the started state so that we can know the process is trying to restart. But now that have a new explicit restarting strate, there is no need to leave it.) android.util.Log$TerribleFailure: Service owner ServiceRecord{436f5168 u0 com.dirtywaterlabs.uberhype/com.dirtywaterlabs.musichype.MDService} cleared while started: pkg=com.dirtywaterlabs.uberhype service=com.dirtywaterlabs.musichype.MDService proc=ProcessState{42bf4bb8 com.dirtywaterlabs.uberhype:remote/10115 pkg=com.dirtywaterlabs.uberhype} at android.util.Log.wtf(Log.java:290) at android.util.Slog.wtfStack(Slog.java:86) at com.android.internal.app.ProcessStats$ServiceState.clearCurrentOwner(ProcessStats.java:2989) at com.android.server.am.ActiveServices.serviceDoneExecutingLocked(ActiveServices.java:1821) at com.android.server.am.ActiveServices.serviceProcessGoneLocked(ActiveServices.java:1779) at com.android.server.am.ActiveServices.removeConnectionLocked(ActiveServices.java:1693) at com.android.server.am.ActiveServices.killServicesLocked(ActiveServices.java:2028) at com.android.server.am.ActivityManagerService.cleanUpApplicationRecordLocked(ActivityManagerService.java:12424) at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:3605) at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:3750) at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1026) at android.os.BinderProxy.sendDeathNotice(Binder.java:493) at dalvik.system.NativeStart.run(Native Method) Change-Id: I25a3fb678b5365254490cd5509b558348655b589
* | am 22a97106: am 8cfa6d08: Merge "Use old task info when creating new task." ↵Craig Mautner2013-11-111-3/+10
|\| | | | | | | | | | | | | into klp-dev * commit '22a9710608d47747f9b834aa2a6b377bf529ad33': Use old task info when creating new task.
| * Use old task info when creating new task.Craig Mautner2013-11-101-3/+10
| | | | | | | | | | | | | | | | | | | | When a new task is being created solely to protect the system from an old task going away, save the info from the old task and use it when creating a new task. Fixes bug 11615548. Change-Id: Ibc3fd15ec4b0d76bce30381fbd83b6899f6a9023
* | am f7dea15b: am c9ffd746: Merge "Don\'t call setTask twice." into klp-devCraig Mautner2013-11-071-9/+22
|\| | | | | | | | | * commit 'f7dea15b8275dd012b1b00b9d781711eff82105a': Don't call setTask twice.
| * Merge "Don't call setTask twice." into klp-devCraig Mautner2013-11-071-9/+22
| |\
| | * Don't call setTask twice.Craig Mautner2013-11-071-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method ActivityRecord.setTask() removes the ActivityRecord from its old task's mActivities ArrayList. In jb-mr2 it did not have this side effect (there was no mActivities) so calling it twice was not a problem. This fix causes setTask to only be called once for the target activity. Fixes bug 11557835. Change-Id: If2b6d4b297e86130009713efe6891a24fad3dd15
* | | am c0eb7e7b: am 20409674: Merge "If home activity is not fullscreen keep ↵Craig Mautner2013-11-071-1/+1
|\| | | | | | | | | | | | | | | | | | | | drilling." into klp-dev * commit 'c0eb7e7b545822dfb3cd43175886f2c97069e122': If home activity is not fullscreen keep drilling.
| * | Merge "If home activity is not fullscreen keep drilling." into klp-devCraig Mautner2013-11-071-1/+1
| |\ \
| | * | If home activity is not fullscreen keep drilling.Craig Mautner2013-11-071-1/+1
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the home activity launches a non-fullscreen activity as part of its own task then ensureActivitiesVisibleLocked() must continue past the launched activity when determining activities to show and hide. Stopping at the non-fullscreen activity leaves the fullscreen home activity hidden. Fixes bug 11555762. Change-Id: I9058d8cde3a41cb7f9b1f97e5c0cb32e9b0f5af7
* | | am f1612bcf: am e8c51298: Merge "Add BatteryStats for Wifi Batched ↵Robert Greenwalt2013-11-071-0/+14
|\| | | | | | | | | | | | | | | | | | | | Scanning." into klp-dev * commit 'f1612bcfdd2cb517948f14369fd0977ceb55d19c': Add BatteryStats for Wifi Batched Scanning.
| * | Merge "Add BatteryStats for Wifi Batched Scanning." into klp-devRobert Greenwalt2013-11-071-0/+14
| |\ \
| | * | Add BatteryStats for Wifi Batched Scanning.Robert Greenwalt2013-11-061-0/+14
| | | | | | | | | | | | | | | | | | | | bug:10690989 Change-Id: Ia39b715ee6d5733970095bc76de0ed40ff8208c0
* | | | am fbf4888d: am 9882d388: Merge "Fix issue #11223338: Not retaining service ↵Dianne Hackborn2013-11-075-43/+90
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | started state while restarting" into klp-dev * commit 'fbf4888d19b0c68d8004f9ad2423a583dc01178e': Fix issue #11223338: Not retaining service started state while restarting
| * | | Merge "Fix issue #11223338: Not retaining service started state while ↵Dianne Hackborn2013-11-075-43/+90
| |\ \ \ | | |/ / | |/| | | | | | restarting" into klp-dev