Since Kitkat, an app pre-loaded under /system/priv-app/ has
FLAG_PRIVILEGED. However, if the app updated and the device
rebooted, privileged flag is unset from pkgFlags. This patch
fix issue to assign privileged flag when scanning the updated
packages.
Bug: 12640283
Change-Id: Ic24b5882f65dabdfae9cc39da3d68661bed4fc31
It is not possible to send a broadcast before the system
boot is completed. If you do it anyway you will get an
IllegalStateException: Cannot broadcast before boot completed.
If a memory card is inserted or removed while the phone is
booting up, there is a risk that the MountService will try to
broadcast a storage intent too early, and cause the device
to crash.
Use FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT to avoid
problems with too early broadcasts.
Change-Id: Ied36a13d235df37c9788e45a35de40d919ae0cd0
Transform DisplayManagerService into a SystemService and start cleaning
up other local services that it uses from window manager and input manager.
Clean up service thread initialization.
Remove unnecessary static variables from ActivityManagerService.
It's starting to become clear that we really need a better way to manage
service dependencies. Boot phases don't quite cut it.
Change-Id: If319dbd7cbfbd4812fe55ece969e818d4b20755b
Refactored SystemServer to get rid of a bunch of legacy cruft related
to how the ServerThread used to be started up.
Create system context first when system server starts. This removes
the tangled initialization order dependency that forced us to start
the activity manager service before most anything else.
Moved factory test related constants into the FactoryTest class.
Partially migrated Installer, ActivityManagerService, and
PowerManagerService to the new SystemService pattern. There's more
work to be done here, particularly around the lifecycle of the
power manager.
Bug: 12172368
Change-Id: Ia527dd56e3b3fd90f9eeb41289dbe044921230d4
*** FATAL EXCEPTION IN SYSTEM PROCESS: ActivityManager
java.lang.NullPointerException
at com.android.server.am.ActivityStack.removeTask(ActivityStack.java:3627)
at com.android.server.am.ActivityStack.removeActivityFromHistoryLocked(ActivityStack.java:2693)
at com.android.server.am.ActivityStack.activityDestroyedLocked(ActivityStack.java:2878)
at com.android.server.am.ActivityStack$ActivityStackHandler.handleMessage(ActivityStack.java:296)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1868)
Change-Id: Ifaf0fe6c62d1f63897d57dc96b4d86d8111b45db
- Release Surface and VirtualDisplay when shutting down ActivityView.
- Shut down child stacks when relaunching parent activity.
Change-Id: I60314b2b43bd2da5406cf6ec871293b5baca157c
Got a little too aggressive about cleaning up service state; need to
avoid removing services from an app until we are in the second loop
doing the final cleanup, otherwise we can leave services around with
restarting their process.
Also fix crash:
W/BinderNative( 667): Uncaught exception from death notification
W/BinderNative( 667): java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
W/BinderNative( 667): at android.util.ArraySet.valueAt(ArraySet.java:301)
W/BinderNative( 667): at com.android.server.am.ActiveServices.killServicesLocked(ActiveServices.java:2069)
W/BinderNative( 667): at com.android.server.am.ActivityManagerService.cleanUpApplicationRecordLocked(ActivityManagerService.java:12412)
W/BinderNative( 667): at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:3596)
W/BinderNative( 667): at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:3744)
W/BinderNative( 667): at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1024)
W/BinderNative( 667): at android.os.BinderProxy.sendDeathNotice(Binder.java:493)
W/BinderNative( 667): at dalvik.system.NativeStart.run(Native Method)
Previously stacks would be removed when the last ActivityRecord was
removed. This causes problems for ActivityContainers which persist and
permit activities to be launched into an empty stack.
Change-Id: Ia79ac65d17c42eff3a7b1321980c21b29996001b
Adding the virtual display to window manager through a handler message
causes timing issues. Add the display directly to fix it.
Change-Id: I3ad6b16ce6dff2a48abd120a8e873e11a028e2c3
With an existing ActivityContainer a caller can now create an
ActivityView which consists of a new VirtualDisplay immediately
attached to the ActivityContainer.
Change-Id: Id70333dcbef55d524a87df8f8c92d72ca5579364
Issue detail:
Assume X, Y are non-fullscreen activities.
a.Home starts an activity X in task A in application stack.
b.X starts an activity Y in <task A> or <new task B>
c.Activity X will be invisible.
How to fix:
Because the function "isActivityOverHome" means an activity is able to see home.
But there may have many non-fullscreen activities between the top non-fullscreen activity and home.
If flag "behindFullscreen" is set, those middle activities will be invisible.
So it should only take care from who is adjacent to home.
Then check two flags frontOfTask(task root) and mOnTopOfHome for constraining the condition.
Change-Id: I60bcea304976414e44835a0a38675aae365e9e19