15413 Commits

Author SHA1 Message Date
Adam Lesinski
3d9bcb90ee Create FEATURE_ constants for print and backup
Bug:13079822

Change-Id: I6f4b759951d45989e8aad4011fae431ee2ecae0c
2014-02-18 14:33:00 -08:00
Jeff Brown
567f7ca424 Refactor dream manager to new pattern.
Change-Id: I99ab4bd98d56a290368dc4b24e5bb24e0656b522
2014-02-13 23:26:59 -08:00
Craig Mautner
474f1fbe8d Merge "Don't null class member before using it." into klp-modular-dev 2014-02-13 19:14:17 +00:00
Craig Mautner
991146f8ef Don't null class member before using it.
Changing the order of detachStack() and usage of mDisplayContent
fixes NPE.

Fixes bug 12823709.

Change-Id: I04760b1d6fd5d3ffc49b99ca4acb47bf7e61cb46
2014-02-13 11:12:42 -08:00
Craig Mautner
0af894d251 Merge "Update DimLayer sizes on rotation." into klp-modular-dev 2014-02-13 19:02:02 +00:00
Craig Mautner
b660b9d8cf Update DimLayer sizes on rotation.
Required replumbing and updating the TaskStack bounds calculations
to match the new separation of TaskStack from DisplayContent.

Fixes bug 12780687.

Change-Id: I061c92831c06f4eb3e673ad6296e721b0c0f3202
2014-02-13 10:59:16 -08:00
Craig Mautner
4b79f8380c Merge "Add debug for 12987986." into klp-modular-dev 2014-02-12 23:44:56 +00:00
Craig Mautner
1646832219 Add debug for 12987986.
For bug 12987986.

Change-Id: Idc122ba369ad7566e3fee290955bf91b0f610ae1
2014-02-12 15:43:40 -08:00
Craig Mautner
731c30c17d Merge "Don't add windows from exiting app tokens twice." into klp-modular-dev 2014-02-12 20:56:36 +00:00
Craig Mautner
ac90c19cab Don't add windows from exiting app tokens twice.
If an apptoken's removal has been delayed then it will be in both
mExitingAppTokens and the stack's tasks. When rebuilding the windows
the windows from that apptoken will get added twice. This change
skips adding those windows from apptokens that have already been
added from mExitingAppTokens.

Change-Id: I55f94b7dbef36aeacb390b91fbe82426eaac5458
2014-02-12 12:37:17 -08:00
John Spurlock
c4aee98a62 Improve error handling in listener services.
Check explicitly for null listeners in NMS, throwing
IllegalArgumentException (on the small list of exceptions
that survive RPC boundaries) with a message.

Normally this situation is caused by listeners that attempt to
perform NM-related actions before they are bound.  Check for
this case in the base NLS class and avoid the call to NM if we
know it will fail.

Although it's tempting to throw an IllegalStateException on the
client side, preserve the existing semantics for backwards-compatibility
purposes.  That is, silently fail (or return null) - and provide a
log warning.

Bug:12805707
Change-Id: I0d92fd0d460a8592e8a23fd8fd718ae2ba3bd4c7
2014-02-12 14:31:36 -05:00
Jeff Brown
38f96e5020 Add support for injecting events into ActivityContainers. (DO NOT MERGE)
Modified ActivityView to inject touch events it receives back into
its activity container.  The container then injects the event into
the input system along with the display id of the underlying virtual
display.

Enhanced the input system to support concurrent dispatch of touch
events on multiple displays which is required for this to work.

Change-Id: I9cf1870db3be6f99a52ed9a1e3ceafe42c940093
2014-02-11 14:43:04 -08:00
Jeff Brown
1b51c9cb96 Merge "Make SystemService constructor take a Context." into klp-modular-dev 2014-02-11 04:12:02 +00:00
Jeff Brown
b880d880c6 Make SystemService constructor take a Context.
This change simplifies the process of initializing a SystemService
by folding the onCreate() step back into the constructor.  It removes
some ambuiguity about what work should happen in the constructor and
should make it possible for services to retain most of their final
fields after refactoring into the new pattern.

Change-Id: I25f41af0321bc01898658ab44b369f9c5d16800b
2014-02-10 20:01:43 -08:00
Craig Mautner
312ba86b47 Change task removal sequence
- Remove task after removing activity. Removing the task before
removing the activity led to problems when the task was still needed.

- In WindowManager wait for activity manager to remove the task.
Previously was automatically removing the task when the last activity
was removed.

Fixes bug 12957434.

Change-Id: I7f6b1f09a2e2a845f177f337769075c9376f8bdb
2014-02-10 17:55:01 -08:00
Craig Mautner
9ef471f7f2 Don't remove Activities and Tasks until animation done
Just like stacks and displays, activities and tasks need to stick
around until animations have completed.

Change-Id: I54fe8f6855d60cbc3a25cbc6e762defd5ac50bf5
2014-02-07 13:11:47 -08:00
Craig Mautner
38f7dcd7dc DO NOT MERGE. Test for Configuration differences before changing.
Changing Configuration first and then testing for changes yields a
result indicating no change.

Fixes bug 12904769.

Change-Id: If7e39e843f15b1143d9877497d595511afabd020
2014-02-06 12:27:20 -08:00
Adam Lesinski
7f41663141 Merge "Check feature bits before loading optional services" into klp-modular-dev 2014-02-06 20:13:21 +00:00
Craig Mautner
1bf2b87347 Defer detach until animations are complete.
Allowing the detach of ActivityStack from DisplayContent to happen
immediately was causing all sorts of problems associated with not
having a Display to complete the animations.

Waiting for animations to complete before either the detach or the
display removal fixes those problems.

Change-Id: I8a5663bfac5c3c1084ff4fcc451e0e38e8080265
2014-02-05 15:37:40 -08:00
Craig Mautner
dc548483ae Move activities from DisplayContent to TaskStack
Now that activities and tasks can be detached from a display do not
keep their state within the DisplayContent class. All such state is
now moved to the TaskStack class with this change.

Change-Id: Ie6b1811e9ec3f545782bad8c3461bd4f2d336b93
2014-02-05 13:35:24 -08:00
Adam Lesinski
898c13df7b Check feature bits before loading optional services
At startup, we check with PackageManager whether a system service is
available before attempting to load it. A system service is available
if its associated feature (similar to hardware features) is present.
This does not remove unavailable services from the compiled jar.

Change-Id: I13571805083aa4e65519a74acb52efd17b9fb3d7
2014-02-05 19:26:40 +00:00
Craig Mautner
df88d73092 Add IIntentSender to ActivityContainer.startActivity
PendingIntents and IntentSenders can now be launched. Still does not
work once the host activity has been paused and resumed.

Window manager TaskStacks now exist independently of Displays and app
windows persist after Displays are removed below them. Attaching the
stack to a new Display does not yet restore the windows to it.

Fixes bug 12747909.

Change-Id: I509007ee23fda400b353f483cf6ecce08177763b
2014-02-04 15:10:13 -08:00
Hui Lu
3cab7fc1b8 Merge "Add proxy as another network." into klp-modular-dev 2014-01-30 22:58:48 +00:00
Hui Lu
1c5624a012 Add proxy as another network.
Change-Id: I70cb6ac5604c4f0d6a752a291c40de2445ae98bb
2014-01-30 17:26:18 -05:00
Narayan Kamath
583b7b1671 am 39a789bf: am 7ae1726d: am aa9ba887: am 6e09eb4c: Merge "AArch64: Make graphics classes 64-bit compatible"
* commit '39a789bf6efd5c3478a442e60e896cae371fd04c':
  AArch64: Make graphics classes 64-bit compatible
2014-01-28 19:26:29 +00:00
Narayan Kamath
39a789bf6e am 7ae1726d: am aa9ba887: am 6e09eb4c: Merge "AArch64: Make graphics classes 64-bit compatible"
* commit '7ae1726d0b962878cce4c1fe6c814a315f253293':
  AArch64: Make graphics classes 64-bit compatible
2014-01-28 19:22:07 +00:00
Narayan Kamath
7ae1726d0b am aa9ba887: am 6e09eb4c: Merge "AArch64: Make graphics classes 64-bit compatible"
* commit 'aa9ba887371e875ffbde49f43fa12bb5f123425b':
  AArch64: Make graphics classes 64-bit compatible
2014-01-28 19:18:40 +00:00
Narayan Kamath
6e09eb4c67 Merge "AArch64: Make graphics classes 64-bit compatible" 2014-01-28 19:12:17 +00:00
Craig Mautner
af17925f94 am 45b68ac3: am 09325627: am 245b58d6: am baf2c7a4: Merge "[ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager"
* commit '45b68ac3a7acb7af95fdfc5c0e31560b3c28c9f8':
  [ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager
2014-01-28 18:17:31 +00:00
Craig Mautner
45b68ac3a7 am 09325627: am 245b58d6: am baf2c7a4: Merge "[ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager"
* commit '093256279c308fd3cad290a1b01c5d313bace8af':
  [ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager
2014-01-28 18:13:55 +00:00
Craig Mautner
093256279c am 245b58d6: am baf2c7a4: Merge "[ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager"
* commit '245b58d6f47740c09ebd47b75e6021c7cfb691af':
  [ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager
2014-01-28 18:11:13 +00:00
Ashok Bhat
a0398430fc AArch64: Make graphics classes 64-bit compatible
Changes in this patch include

[x] Long is used to store native pointers as they can
    be 64-bit.

[x] Some minor changes have been done to conform with
    standard JNI practice (e.g. use of jint instead of int
    in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
    yet. Specifically mAtlasMap member has to be converted
    to hold native pointer using long. Added a TODO to
    AssetAtlasManager.java to indicate the change required.

Change-Id: I940433f601c6db998c1a8ffff338f5361200d5ed
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
2014-01-28 17:40:38 +00:00
louis_chang
d5c91ece7b [ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager
Symptom:
When press Home key to home screen, user is able to see the activity's window shown on top of wallpaper and below launcher(widgets).

Root Cause:
The ensureActivitiesVisibleLocked() is called pretty often (for example when a new process bound).
If the top activity "B" was finishing, then the previous activity "A" should be visible.
Therefore, the activity "A" window will be set to visible and then launched activity "A", but it does not updates the visible state in ActivityRecord for "A".
There has a timing issue that if a new activity "C" is started, "C" becomes the new top activity and be resumed.
In that case, Activity "A" window will remain visible even if it is behind a full screen activity "C" because the ActivityRecord.visble of "A" is still false, so the window visibility won't be update.
So when user press home key and back to launcher, the surface of activity "A" will be composed on top of wallpaper.

Solution:
Updates ActivityRecord.visible to true for "A". After "C" is started, the "A" will be called WindowManagerService.setAppVisibility() to set invisible, then called onStop() when execute ensureActivitiesVisibleLocked() again.

Change-Id: I536ba04b95d8d274fea6d679a6493e620bc981e2
2014-01-28 18:38:06 +08:00
Craig Mautner
38eda9c42b Remove unnecessary logging.
Fixes bug 12593710.

Change-Id: I55c33bb4d6c9e17e810be7cc033e01fb9d2d6cf7
2014-01-24 17:26:52 -08:00
Christopher Tate
222496f82f am 5d734dbc: am e1d18f6e: am 0e3df216: am cc81bcec: Merge "Only send storage intents after boot complete"
* commit '5d734dbc56cd2d4350f4a35f1bedbb6b40247e5c':
  Only send storage intents after boot complete
2014-01-23 00:01:01 +00:00
Christopher Tate
5d734dbc56 am e1d18f6e: am 0e3df216: am cc81bcec: Merge "Only send storage intents after boot complete"
* commit 'e1d18f6eb0e46b7a71ce7cf9ddb1c60dd7ad054f':
  Only send storage intents after boot complete
2014-01-22 23:57:47 +00:00
Christopher Tate
e1d18f6eb0 am 0e3df216: am cc81bcec: Merge "Only send storage intents after boot complete"
* commit '0e3df21642122ae8a43be1a35723782bdd417b7a':
  Only send storage intents after boot complete
2014-01-22 15:53:58 -08:00
Christopher Tate
cc81bcece4 Merge "Only send storage intents after boot complete" 2014-01-22 23:46:58 +00:00
Christopher Tate
46c95dfc10 am b450505c: am a7a9327b: am 5474f085: am 9fc157a4: Merge "FLAG_PRIVILEGED disappears if privileged app is updated and rebooted"
* commit 'b450505c2e0d0dfd67bc228961a00a6eaaf092df':
  FLAG_PRIVILEGED disappears if privileged app is updated and rebooted
2014-01-22 01:55:07 +00:00
Christopher Tate
b450505c2e am a7a9327b: am 5474f085: am 9fc157a4: Merge "FLAG_PRIVILEGED disappears if privileged app is updated and rebooted"
* commit 'a7a9327be8b2b2ee2a461d1a0558c0c7b5b9271c':
  FLAG_PRIVILEGED disappears if privileged app is updated and rebooted
2014-01-22 01:51:34 +00:00
Christopher Tate
a7a9327be8 am 5474f085: am 9fc157a4: Merge "FLAG_PRIVILEGED disappears if privileged app is updated and rebooted"
* commit '5474f085b05b527f7e1dc7c6f536736c2f043fb0':
  FLAG_PRIVILEGED disappears if privileged app is updated and rebooted
2014-01-21 17:48:35 -08:00
Naofumi Harada
719b3b8075 FLAG_PRIVILEGED disappears if privileged app is updated and rebooted
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
2014-01-21 07:41:11 +00:00
Johan Redestig
0464c07a9e Only send storage intents after boot complete
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
2014-01-18 22:46:56 +01:00
Jeff Brown
4ccb823a9f Refactor display manager service to new pattern.
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
2014-01-16 22:16:42 -08:00
Jeff Brown
6f357d3284 Start untangling system server early bootstrapping.
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
2014-01-16 11:24:58 -08:00
Jeff Brown
02cc684e42 Delete unused power manager functionality.
timeSinceScreenWasLastOn() was used by Watchdog previously but is no
longer so we can remove it.

Change-Id: I91c324b6c98c1aeb85f64b0296a41240e6c2ef4f
2014-01-16 11:24:58 -08:00
Craig Mautner
593a4e6f98 Fix NPE when destroyActivity occurs after detach.
*** 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
2014-01-15 17:59:22 -08:00
Craig Mautner
34b73dfaa3 Cleanup after ActivityView
- Release Surface and VirtualDisplay when shutting down ActivityView.
- Shut down child stacks when relaunching parent activity.

Change-Id: I60314b2b43bd2da5406cf6ec871293b5baca157c
2014-01-15 17:47:51 -08:00
Craig Mautner
9cfb2e5f4c Merge "Retain stacks even if they are empty." into klp-modular-dev 2014-01-15 01:07:15 +00:00
Dianne Hackborn
6873e17d4b am 305c61a1: am 3a8a8ddd: am 8c359bf4: am c174288d: Fix issue #12031685: Sticky Service Breakage in Android 4.4.1
* commit '305c61a1c6816549b225719518df5b29a17f0f42':
  Fix issue #12031685: Sticky Service Breakage in Android 4.4.1
2014-01-14 01:53:07 +00:00