449 Commits

Author SHA1 Message Date
Brian Carlstrom
f4bdcaba5d Remove member "m" prefix from now local variables
Change-Id: I7808cafc1f74c47fcd9d9a4b6a90fb50951457b1
2013-08-02 19:49:15 -07:00
Brian Carlstrom
b33278f876 Teach PackageManager to skip core-libart.jar
A little grossness for now to support dual booting Dalvik and Art.

While I was here, removed isDexOptNeeded calls for boot class path which already return false.

Change-Id: Iaaaf21b7733c1791e7bd8ae27e84c47463f9e9c9
2013-08-01 13:55:07 -07:00
Christopher Tate
072252cd48 Fix permission privilege w.r.t. updated system apps
Note that it is *intentional* that even a privileged app cannot
add new privileged permissions via unbundled update.  The set of
privileged permissions granted is strictly limited to those used
by the apk file installed as privileged.

Bug 10027033

Change-Id: I974bae0671c1962e4526d51dd9a0c53bcd27323e
2013-07-29 17:13:35 -07:00
Dianne Hackborn
5cf6663c80 Merge "Add new facility for apps to declared their preferred intents." 2013-07-23 18:30:18 +00:00
Amith Yamasani
0343ec3abb User restriction API to disable single-user restrictions feature.
Change-Id: I80e08b38b5e32f3cb1af51398907510508ec199f
2013-07-23 09:17:21 -07:00
Dianne Hackborn
b09491f271 Add new facility for apps to declared their preferred intents.
This is an extension from the existing data/etc/perferred-apps
facility.  Now applications pre-installed on the system image
can declare which intents they would like to be considered the
preferred app for.  When the system firsts initializes, or the
application settings are reset, these are used to configured
the current preferred app settings appropriately.

You use this with a new <preferred> tag under your activity,
which indicates which intents you would like to be the preferred
handler for.  The syntax for this is written much like an
intent filter, however semantically it is not really an intent
filter and so has some important differences:

- You can not use globbing patterns (for SSPs or paths).
- You can use only one action (if you use more than one it
  will only use the first one, so be careful).

Semantically what this is actually used for is a template
from which to generate a set of Intent objects, which are used
to probe the current environment in order to see if there are
multiple activities that can handle the Intent and, if so,
generate a new preferred setting for that pointing to your app.

As an example, here is how the preferred tag might be written
for the Maps application:

            <preferred>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="http" />
                <data android:scheme="https" />
                <data android:host="maps.google.com" />
                <data android:path="/" />
                <data android:pathPrefix="/maps" />
            </preferred>
            <preferred>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="geo" />
            </preferred>

From this, we generate the following set of potential Intents
to be matched, all with ACTION_VIEW, CATEGORY_DEFAULT+CATEGORY_BROWSABLE:

Change-Id: I7fd42aec8b6109c7dd20012529662362f1b7437a
http://maps.google.com/
http://maps.google.com/maps
https://maps.google.com/
https://maps.google.com/maps
geo:
2013-07-22 15:30:11 -07:00
Amith Yamasani
1a7472e722 Have UserManagerService clear the restrictions and unblock apps
Since this is an operation that could take a few seconds to run and needs to be
completed even if Settings dies, best to do it in the user manager.

Refactored PIN challenge/setup UI with a field to verify existing pin
when changing to a new one.

Change-Id: I0b7df5b2ccb7f343aa9282a9245d3bc2b577a794
2013-07-18 16:12:27 -07:00
Christopher Tate
409bb36a13 Out-of-band apk pushes to the privileged install dir
The new apk will now correctly allow system permissions to an app
placed in the privileged install dir via 'adb push' on the fly.

Change-Id: Ie4284d12628e08d9562d18eee6a7e8f74ae6295e
2013-07-12 12:33:09 -07:00
Kenny Root
3b4d69508a Merge "KeySetManager: convert comments to Javadoc" 2013-07-10 19:35:49 +00:00
Amith Yamasani
235e817c80 Merge "Clean up any restrictions files that shouldn't be there." 2013-07-09 18:32:41 +00:00
Amith Yamasani
b82add27d0 Clean up any restrictions files that shouldn't be there.
Partially fixes the mess that was caused by #9681399

Change-Id: Iaabe15c87d1b002f0b2210b34adcc31b8fb4329c
2013-07-09 11:24:44 -07:00
Kenny Root
2042e9df48 KeySetManager: convert comments to Javadoc
To help with development, change comments to Javadoc and adding some
links.

Change-Id: Id97febd978f14bace8242d8e0610b1166a13265b
2013-07-08 16:28:35 -07:00
Kenny Root
ee302758d6 Merge "KeySetManager: change KEYSET_NOT_FOUND to public" 2013-07-08 20:25:27 +00:00
Ying Wang
fb236b56d2 Fix build.
Change-Id: I2348e75e95581b1e5acf1c52b83948e46547a19e
2013-07-08 10:53:58 -07:00
Kenny Root
9a995f57a3 KeySetManager: change KEYSET_NOT_FOUND to public
Make the constant KEYSET_NOT_FOUND so that other source code components
can use that as the sentinel value directly instead of -1

Change-Id: If89de5fb312d55e360b96aadbc6effcd480043b2
2013-07-08 09:37:24 -07:00
Kenny Root
df0e6abd9f KeySetManager: add keyset aliases to dump
Add the list of aliases defined to the dumpsys output.

Change-Id: I8bba20fba8dd123f749372cab7b8f038aa47331f
2013-07-03 13:40:16 -07:00
Kenny Root
92179bc261 KeySetManager: iterate over correct list
Change-Id: I43e18e824e62b3ec54964ace1485a45616b962f2
2013-07-02 11:55:45 -07:00
Amith Yamasani
5fa9f2b127 Merge "Single-user restrictions" 2013-06-26 23:04:32 +00:00
Christopher Tate
46eadae12f Make sure to propagate privileged status when upgrading an app
Bug 9470309

Change-Id: Ibc0c8b2fa01da1bd5f5b6ed5530a6bd9a1384846
2013-06-26 14:22:21 -07:00
Amith Yamasani
655d0e2029 Single-user restrictions
Introduces a new "blocked" state for each package. This is used to temporarily
disable an app via Settings->Restrictions.

PIN creation and challenge activities for use by Settings and other apps. PIN
is stored by the User Manager and it manages the interval for retry attempts
across reboots.

Change-Id: I4915329d1f72399bbcaf93a9ca9c0d2e69d098dd
2013-06-25 16:03:55 -07:00
Christopher Tate
a5df9aa497 am 3c0cd0b5: am 34718238: am 3e7d0344: Merge "Avoid adding FORWARD_LOCK flag to an updated system app"
* commit '3c0cd0b54064f81a6a74d895707453fb0132719c':
  Avoid adding FORWARD_LOCK flag to an updated system app
2013-06-25 16:02:13 -07:00
Dianne Hackborn
8c84109b9f Use FastPrintWriter... everywhere.
One problem this turned up is, because FastPrintWriter does
its own buffering, a lot of code that used to use PrintWriter
would fail -- if it pointed to a StringWriter, there was no
buffering, so it could just immediately get the result.  Now
you need to first flush the FastPrintWriter.

Also added some new constructors to specify the size of buffer
that FastPrintWriter should use.

Change-Id: If48cd28d7be0b6b3278bbb69a8357e6ce88cf54a
2013-06-24 18:16:48 -07:00
Christopher Tate
347182386c am 3e7d0344: Merge "Avoid adding FORWARD_LOCK flag to an updated system app"
* commit '3e7d0344399ac2f607fddde32c1a5e54228a38f9':
  Avoid adding FORWARD_LOCK flag to an updated system app
2013-06-24 16:05:49 -07:00
Christopher Tate
3e7d034439 Merge "Avoid adding FORWARD_LOCK flag to an updated system app" 2013-06-24 23:02:00 +00:00
Geremy Condra
a2d8eae289 Remove logging of KeySet parse errors.
Bug: 9532748
Change-Id: I3cce41de74783a121d2cd4f7b0ea6dfa03e3d7c5
2013-06-21 16:59:42 -07:00
Geremy Condra
e201f581f6 Merge "Stop spewing errors into the logs." 2013-06-18 18:02:14 +00:00
Geremy Condra
bf7b1f4744 Stop spewing errors into the logs.
These are for debugging. Marking them that way.

Bug: 9479475
Change-Id: Ia0c27829583ecbab58a60a8c8350e9c099b812c2
2013-06-18 10:52:45 -07:00
Christopher Tate
ccbf84f44c Some system apps are more system than others
"signatureOrSystem" permissions are no longer available to all apps
residing en the /system partition.  Instead, there is a new /system/priv-app
directory, and only apps whose APKs are in that directory are allowed
to use signatureOrSystem permissions without sharing the platform cert.
This will reduce the surface area for possible exploits of system-
bundled applications to try to gain access to permission-guarded
operations.

The ApplicationInfo.FLAG_SYSTEM flag continues to mean what it is
says in the documentation: it indicates that the application apk was
bundled on the /system partition.  A new hidden flag FLAG_PRIVILEGED
has been introduced that reflects the actual right to access these
permissions.

At some point the "system" permission category will be
renamed to "privileged".

Bug 8765951

Change-Id: I6f0fd9cdb9170e076dfc66d83ecea76f8dd7335d
2013-06-17 12:47:35 -07:00
Dianne Hackborn
df1c0bf774 Add scheme specific part to IntentFilter.
Change-Id: I063d086cdc742800b8e31ddf2942f2e9230e2785
2013-06-12 18:08:17 -07:00
Dianne Hackborn
cbfd23ee6f Add new API to retrieve a dumpsys of a single package.
Adds a platform API, and pm command.  Fixes some issues with
dumping per-package data in package manager, makes battery
stats able to dump per-package state.

Change-Id: I76ee6d059f0ba17f7a7061886792b1b716d46d2d
2013-06-11 14:26:53 -07:00
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