416 Commits

Author SHA1 Message Date
Dianne Hackborn
21d9b56692 Add more details about why a force stop is happening.
Change-Id: Ia938cf6fc37ad22fc7447dc538968c7bd234be7d
2013-05-28 17:46:59 -07:00
Dianne Hackborn
f4bf0ae2a7 New ArrayMap class.
This is a new kind of key/value mapping that stores its data
as an array, so it doesn't need to create an extra Entry object
for every mapping placed in to it.  It is also optimized to reduce
memory overhead in other ways, by keeping the base object small,
being fairly aggressive about keeping the array data structures
small, etc.

There are some unit and performance tests dropped in to some
random places; they will need to be put somewhere else once I
decided what we are going to do with this for the next release
(for example if we make it public the unit tests should go in
to CTS).

Switch IntentResolver to using ArrayMap instead of HashMap.

Also get rid of a bunch of duplicate implementations of binarySearch,
and add an optimization to the various sparse arrays where you can
supply an explicit 0 capacity to prevent it from doing an initial
array allocation; use this new optimization in a few places where it
makes sense.

Change-Id: I01ef2764680f8ae49938e2a2ed40dc01606a056b
2013-05-24 16:36:14 -07:00
Dianne Hackborn
9f337b694a am 46449b8b: am d31db759: Merge "Fix issue #9000597: PackageManager get NPE while running performance plan" into jb-mr2-dev
* commit '46449b8bbca2b937771d284c081012ff4696cbe2':
  Fix issue #9000597: PackageManager get NPE while running performance plan
2013-05-17 13:36:21 -07:00
Dianne Hackborn
46449b8bbc am d31db759: Merge "Fix issue #9000597: PackageManager get NPE while running performance plan" into jb-mr2-dev
* commit 'd31db759cba78447ba1f4286a84c27a30a5aeb5c':
  Fix issue #9000597: PackageManager get NPE while running performance plan
2013-05-17 13:34:30 -07:00
Dianne Hackborn
2c44c74b88 Fix issue #9000597: PackageManager get NPE while running performance plan
Change-Id: I2bf777e8b15704d21320f95059d94648122396a8
2013-05-17 12:07:21 -07:00
Christopher Tate
84c6e6b327 am f0571539: am f95fdc97: Merge "Maintain restrictions when downgrading system apps" into jb-mr2-dev
* commit 'f0571539801b0cf11ddb37d377343bcc86218bd1':
  Maintain restrictions when downgrading system apps
2013-05-14 17:20:12 -07:00
Christopher Tate
f057153980 am f95fdc97: Merge "Maintain restrictions when downgrading system apps" into jb-mr2-dev
* commit 'f95fdc9754eea76066905424044b7c6d43c60c2d':
  Maintain restrictions when downgrading system apps
2013-05-14 17:18:15 -07:00
Christopher Tate
acee6e9121 Maintain restrictions when downgrading system apps
When an upgraded system-bundled app is reverted to the factory
version, we now maintain restricted profiles' access policies
w.r.t. that app.

Bug 8905395

Change-Id: I3f230ac3f70a77fb14c0180b44c9b42fc49250a2
2013-05-14 16:47:07 -07:00
Dianne Hackborn
fa012b35b8 Improve watchdog error reporting.
We now keep track of all the threads that are stopped, and
print stacks for all of them.  Also more threads are now adding
themselves to the watchdog.

Unfortunately the stack we get from threads is far less useful
than the stacks from the ANR report, because these don't include
any information about the lock the thread is blocked on and what
thread is holding that lock.  For example, here is a test of the
log output from causing a hang in the system process:

W/Watchdog( 5205): *** WATCHDOG KILLING SYSTEM PROCESS: com.android.server.am.ActivityManagerService, main thread
W/Watchdog( 5205): foreground thread stack trace:
W/Watchdog( 5205):     at com.android.server.am.ActivityManagerService.monitor(ActivityManagerService.java:14333)
W/Watchdog( 5205):     at com.android.server.Watchdog$HandlerChecker.run(Watchdog.java:142)
W/Watchdog( 5205):     at android.os.Handler.handleCallback(Handler.java:730)
W/Watchdog( 5205):     at android.os.Handler.dispatchMessage(Handler.java:92)
W/Watchdog( 5205):     at android.os.Looper.loop(Looper.java:137)
W/Watchdog( 5205):     at android.os.HandlerThread.run(HandlerThread.java:61)
W/Watchdog( 5205): main thread stack trace:
W/Watchdog( 5205):     at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:12252)
W/Watchdog( 5205):     at android.app.ContextImpl.sendBroadcastAsUser(ContextImpl.java:1158)
W/Watchdog( 5205):     at com.android.server.DropBoxManagerService$3.handleMessage(DropBoxManagerService.java:161)
W/Watchdog( 5205):     at android.os.Handler.dispatchMessage(Handler.java:99)
W/Watchdog( 5205):     at android.os.Looper.loop(Looper.java:137)
W/Watchdog( 5205):     at com.android.server.ServerThread.initAndLoop(SystemServer.java:1050)
W/Watchdog( 5205):     at com.android.server.SystemServer.init2(SystemServer.java:1125)
W/Watchdog( 5205):     at com.android.server.SystemServer.init1(Native Method)
W/Watchdog( 5205):     at com.android.server.SystemServer.main(SystemServer.java:1116)
W/Watchdog( 5205):     at java.lang.reflect.Method.invokeNative(Native Method)
W/Watchdog( 5205):     at java.lang.reflect.Method.invoke(Method.java:525)
W/Watchdog( 5205):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
W/Watchdog( 5205):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
W/Watchdog( 5205):     at dalvik.system.NativeStart.main(Native Method)
I/Process ( 5205): Sending signal. PID: 5205 SIG: 9

Change-Id: I8ff9892d8d072d8dc599a73de4bdb75e3b1a6e97
2013-05-13 18:01:54 -07:00
Amith Yamasani
ecd5afe1ef resolved conflicts for merge of 069d7e9b to master
Change-Id: Ia8fd5de3d4cc275fd358132bcb2c198d1e7b6877
2013-05-09 17:07:08 -07:00
Amith Yamasani
069d7e9b81 am 153919ed: Merge "Cache the scaled avatar drawables in the keyguard user switcher" into jb-mr2-dev
* commit '153919ed2f128fb5d1b55782ea89fadcc20fc841':
  Cache the scaled avatar drawables in the keyguard user switcher
2013-05-09 16:23:31 -07:00
Amith Yamasani
6fc1d4e8e6 Cache the scaled avatar drawables in the keyguard user switcher
Loading the avatar icons and drawing them into the sized bitmap
turns out to be quite expensive and the cost increases with number
of users. Caching them shaves off several hundred milliseconds from
Keyguard inflation time during user switching on the lockscreen.

For instance, 15ms vs. 750ms with 3 avatars on a certain 7" tablet.

Bug: 7986933
Change-Id: I3e2065bfa25aa263133ba204ca364c3b04d7c0ff
2013-05-09 14:44:38 -07:00
Dianne Hackborn
0c8949db30 am 4c41f6cd: am 856a5a86: Merge "Fix issue #8768456: Settings > App Info under reports..." into jb-mr2-dev
* commit '4c41f6cd1852aaeeb067ad568c3b77a816769d64':
  Fix issue #8768456: Settings > App Info under reports...
2013-05-02 15:17:32 -07:00
Dianne Hackborn
4c41f6cd18 am 856a5a86: Merge "Fix issue #8768456: Settings > App Info under reports..." into jb-mr2-dev
* commit '856a5a860e11a85f8fbb1ad07f6ef444abeafbaf':
  Fix issue #8768456: Settings > App Info under reports...
2013-05-02 15:15:19 -07:00
Christopher Tate
b4997af5cf am 77a66f44: am b8453357: Merge "Send package-changed broadcasts to the correct users" into jb-mr2-dev
* commit '77a66f44590853cce7c58d643b6064ed5974cf03':
  Send package-changed broadcasts to the correct users
2013-05-02 15:14:06 -07:00
Christopher Tate
77a66f4459 am b8453357: Merge "Send package-changed broadcasts to the correct users" into jb-mr2-dev
* commit 'b84533575601133868bf414c526b5b30de3e62c6':
  Send package-changed broadcasts to the correct users
2013-05-02 15:11:52 -07:00
Dianne Hackborn
856a5a860e Merge "Fix issue #8768456: Settings > App Info under reports..." into jb-mr2-dev 2013-05-02 22:11:36 +00:00
Christopher Tate
1e08f5c3b3 Send package-changed broadcasts to the correct users
Also be sure to drop any pending package-changed broadcasts
that are targeted to a now-removed user.

Bug 8594153

Change-Id: Ib14874b4a67b968bbf6ca12ee095c85383aff324
2013-05-02 14:18:51 -07:00
Dianne Hackborn
ecc8d6f114 Fix issue #8768456: Settings > App Info under reports...
...app storage size for apps w/ .so files

The lib directories are tagged with the apk install number,
so must be explicitly passed down to installd.

Change-Id: Ic37b03726f9a7405eb05956703f8198223b22595
2013-05-02 11:17:15 -07:00
Christopher Tate
7abc275e80 am bd5fca23: am eed8411c: Merge "Bootstrap installed system apps only when the target user is running" into jb-mr2-dev
* commit 'bd5fca23e12f2a3491ea63e5761a5897f084d689':
  Bootstrap installed system apps only when the target user is running
2013-05-01 15:53:17 -07:00
Christopher Tate
bd5fca23e1 am eed8411c: Merge "Bootstrap installed system apps only when the target user is running" into jb-mr2-dev
* commit 'eed8411c8cc1f163ba06a928e3b4b6d3f1045282':
  Bootstrap installed system apps only when the target user is running
2013-05-01 15:50:42 -07:00
Christopher Tate
3335644f7a Bootstrap installed system apps only when the target user is running
I.e. don't bother trying to send a BOOT_COMPLETED broadcast to the
newly-installed/enabled system app when its host user isn't live.

Also use the static isSystemApp()-type helpers instead of duplicating
those tests locally.

Bug 8594153

Change-Id: I4bd0b86351d67f72c44eae8d1afce6a98f034d31
2013-05-01 14:25:26 -07:00
Christopher Tate
9f9dc4b230 am 6e629e84: am 95a9bfe2: When installing/enabling a system app, bootstrap it
* commit '6e629e84c52c870ff6fe6d0493861997929209f4':
  When installing/enabling a system app, bootstrap it
2013-04-30 17:50:50 -07:00
Christopher Tate
6e629e84c5 am 95a9bfe2: When installing/enabling a system app, bootstrap it
* commit '95a9bfe2ba75d79fff8157ed57e75c4ffb5a08ac':
  When installing/enabling a system app, bootstrap it
2013-04-30 17:48:59 -07:00
Christopher Tate
95a9bfe2ba When installing/enabling a system app, bootstrap it
Specifically, send it a BOOT_COMPLETED broadcast just as it would have
received during device (or user) startup.

Bug 8594153

Change-Id: I847c16df56d038a25758e594f951bc15348edc19
2013-04-30 17:40:32 -07:00
Amith Yamasani
c1ce6e1a79 am ac16c21d: am a0042742: Merge "Modify restrictions bundle per api council recommendations" into jb-mr2-dev
* commit 'ac16c21d11c1545efb8deafbcb7c120a5e0821a1':
  Modify restrictions bundle per api council recommendations
2013-04-17 11:34:28 -07:00
Amith Yamasani
ac16c21d11 am a0042742: Merge "Modify restrictions bundle per api council recommendations" into jb-mr2-dev
* commit 'a0042742c8941519718cc8872a84cfec10294386':
  Modify restrictions bundle per api council recommendations
2013-04-17 11:30:41 -07:00
Amith Yamasani
7e99bc02c8 Modify restrictions bundle per api council recommendations
Use a Bundle for persisting and passing to the application, but use a
list to return data back from an application that's exposing restrictions.

Changed the xml reading/writing code to store the value type in the Bundle
so that it can be reproduced when reading. Earlier we were assuming only
String and String[].

Bug: 8633967

Change-Id: I523d5553728edcf28a1e9d432f490b4956f34215
2013-04-17 10:44:44 -07:00
Emily Bernier
d65b268fcd am 9b8abb5a: am ce70311b: Merge "Add user restrictions (credentials, user removal)" into jb-mr2-dev
* commit '9b8abb5abde4264b6ed4e022804c743faf68323d':
  Add user restrictions (credentials, user removal)
2013-04-12 13:29:35 -07:00
Emily Bernier
9b8abb5abd am ce70311b: Merge "Add user restrictions (credentials, user removal)" into jb-mr2-dev
* commit 'ce70311b67c3dba6ed4fbda41617f4e24c82dfc7':
  Add user restrictions (credentials, user removal)
2013-04-12 13:25:58 -07:00
Emily Bernier
ce70311b67 Merge "Add user restrictions (credentials, user removal)" into jb-mr2-dev 2013-04-12 20:21:36 +00:00
Kenny Root
7415737326 am 12cff6f6: am 10a25c0a: Merge "Remove keystore entries when app data cleared" into jb-mr2-dev
* commit '12cff6f6289cb6bb06b716e75e7776099343323a':
  Remove keystore entries when app data cleared
2013-04-12 12:00:59 -07:00
Kenny Root
12cff6f628 am 10a25c0a: Merge "Remove keystore entries when app data cleared" into jb-mr2-dev
* commit '10a25c0af785ee0daa735fc9a26571fb4c27399a':
  Remove keystore entries when app data cleared
2013-04-12 11:56:53 -07:00
Kenny Root
6fd1c85d7f Remove keystore entries when app data cleared
When an application's user data is cleared, the keystore entries need to
be cleared as well. Previously we were only clearing entries when the
application was uninstalled for all users. Now we cover the case of
multiuser as well.

Bug: 8566369
Change-Id: I201c92d0893f0d18e87970dcd59ef6cd904584dc
2013-04-12 10:09:02 -07:00
Geremy Condra
c797b40ade am 64ef8ed8: am 68913baf: Merge "Remove /data/system location for mac_permissions.xml."
* commit '64ef8ed88c435108bec7f780fb9d8378422c5751':
  Remove /data/system location for mac_permissions.xml.
2013-04-11 19:07:49 -07:00
Geremy Condra
64ef8ed88c am 68913baf: Merge "Remove /data/system location for mac_permissions.xml."
* commit '68913baf72832226c0788bdba885e92e186cc2d8':
  Remove /data/system location for mac_permissions.xml.
2013-04-11 19:05:10 -07:00
Emily Bernier
b223f73a69 Add user restrictions (credentials, user removal)
Created constants in current.txt and UserManager.java, modified restrictions access in UserManagerService.java.

Change-Id: If8d778d84af81dcbf5784f6e0afd9ef966cc8ecf
2013-04-11 19:56:49 -04:00
Amith Yamasani
0086153dbf am 36f73e25: am 9429afba: Fix a security check in getting app restrictions
* commit '36f73e2539c08a51a165df000b9bd0a299458877':
  Fix a security check in getting app restrictions
2013-04-10 18:50:41 -07:00
Amith Yamasani
36f73e2539 am 9429afba: Fix a security check in getting app restrictions
* commit '9429afba06d96973ea4bf76abba945dd92a1debb':
  Fix a security check in getting app restrictions
2013-04-10 18:47:01 -07:00
Amith Yamasani
9429afba06 Fix a security check in getting app restrictions
Change-Id: I02fbab8765d3f8646d0fe62ee867566d1d14707d
2013-04-10 18:40:51 -07:00
Christopher Tate
e775cee176 am 04f5c8cb: am 790518a1: Merge "Implicitly enable system apps when updates installed" into jb-mr2-dev
* commit '04f5c8cb95f1f4f09bc0feacab36088066e58afb':
  Implicitly enable system apps when updates installed
2013-04-10 17:08:42 -07:00
Christopher Tate
04f5c8cb95 am 790518a1: Merge "Implicitly enable system apps when updates installed" into jb-mr2-dev
* commit '790518a1a2f06030d19fdd896bd0f80dd03d94fc':
  Implicitly enable system apps when updates installed
2013-04-10 17:04:46 -07:00
Christopher Tate
790518a1a2 Merge "Implicitly enable system apps when updates installed" into jb-mr2-dev 2013-04-10 23:58:37 +00:00
Christopher Tate
32a019d438 Implicitly enable system apps when updates installed
If someone explicitly installs an update to a system-bundled package,
we infer that this means they actually want to use the new code.

Bug 7467302

Change-Id: If2dc6f764bafbb3a5c94cbdd32273c030fd784b9
2013-04-09 17:11:55 -07:00
Dianne Hackborn
875422153d resolved conflicts for merge of e9b4ee69 to master
Change-Id: Id752ae94f63a66b2ec200f68c73bf0d7b04b249f
2013-04-09 11:56:06 -07:00
Dianne Hackborn
e9b4ee692c am 558a3c1b: Merge "Kill processes when permissions are revoked." into jb-mr2-dev
* commit '558a3c1b7b40eb9356f8c4446ca63af8cf16bd91':
  Kill processes when permissions are revoked.
2013-04-09 10:42:09 -07:00
Dianne Hackborn
558a3c1b7b Merge "Kill processes when permissions are revoked." into jb-mr2-dev 2013-04-09 17:38:00 +00:00
Dianne Hackborn
f1b782427f Kill processes when permissions are revoked.
Some permissions are associated with gids, so we need to
kill any running processes if their permission is revoked.
We will do this for any permission being revoked, since
the association between gids and permissions can change
over time.

Change-Id: Ieb7408e032539c4f21eb089d65a7a7e6c289f010
2013-04-08 22:28:59 -07:00
Kenny Root
c21e2cb672 am b3be67ce: am 0eee410e: Merge "Check outInfo is not null" into jb-mr2-dev
* commit 'b3be67ce34966dfccfccf4918ee5c93c4971a6d0':
  Check outInfo is not null
2013-04-08 17:05:50 -07:00
Kenny Root
b3be67ce34 am 0eee410e: Merge "Check outInfo is not null" into jb-mr2-dev
* commit '0eee410e473c1546af80c63ec866655a28833f33':
  Check outInfo is not null
2013-04-08 16:16:44 -07:00