History log of /frameworks/base/core/java/android/content/pm/PackageParser.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bf0c1ac1098f5d3be70ba7e7a62b94ffedf734af 09-Jul-2015 Christopher Tate <ctate@google.com> Remote extraneous debugging log message

Bug 22069429

Change-Id: I4e3803aff58449b2544d9d7cca27d8d2115ccdd6
/frameworks/base/core/java/android/content/pm/PackageParser.java
6dce4964b4d1a13d276d95730b8fb09d6a5a8d04 04-Jul-2015 Jeff Sharkey <jsharkey@android.com> Reconcile private volumes when mounted.

Many things can happen while a private volume is ejected, so we need
to reconcile newly mounted volumes against known state.

First, user IDs can be recycled, so we store the serial number in the
extended attributes of the /data/user/[id] directory inode. Since a
serial number is always unique, we can quickly determine if a user
directory "10" really belongs to the current user "10". When we
detect a mismatched serial number, we destroy all data belonging to
that user. Gracefully handles upgrade case and assumes current serial
number is valid when none is defined.

Second, we destroy apps that we find no record of, either due to
uninstallation while the volume was unmounted, or reinstallation on
another volume.

When mounting a volume, ensure that data directories exist for all
current users. Similarly, create data directories on all mounted
volumes when creating a user. When forgetting a volume, gracefully
uninstall any apps that had been installed on that volume.

Bug: 20674082, 20275572
Change-Id: I4e3448837f7c03daf00d71681ebdc96e3d8b9cc9
/frameworks/base/core/java/android/content/pm/PackageParser.java
ffd25bbed1345a932b1338a210405d1f42daf07b 30-Jun-2015 Svet Ganov <svetoslavganov@google.com> Rename uses-permission-m to uses-permission-23

bug:20072113

Change-Id: Ia872853274c604a6fee1c1d84f82a98334523bac
/frameworks/base/core/java/android/content/pm/PackageParser.java
adc1cf46045ae756d3a9ccbccf6b0f894e4c1edd 16-Jun-2015 Svet Ganov <svetoslavganov@google.com> Only grant runtime permissions to special components.

Now runtime permissions are granted only to components that are
part of the system or perform special system operations. For
exmple, the shell UID gets its runtime permissions granted by
default and the default phone app gets the phone permissions
granted by default.

bug:21764803

Change-Id: If8b8cadbd1980ffe7a6fc15bbb5f54a425f6e8f9
/frameworks/base/core/java/android/content/pm/PackageParser.java
acc2df21de9da66d8aaf9bf2b733f8b284454403 17-Jun-2015 dcashman <dcashman@google.com> Merge "Add keyset support for ECDSA public keys." into mnc-dev
4f5e8b3ca489245005b76176ac6d28f5f184f3fe 12-Jun-2015 Jeff Sharkey <jsharkey@android.com> Valid filenames have length limits!

ext4 filenames are at most 255 bytes. vfat filenames are bit more
lax, but we're often saving them on ext4 through a FUSE daemon, so
limit them the same way.

Since package names are used as directory names, verify that they're
valid filenames.

Tests to verify behavior.

Bug: 18689171
Change-Id: If7df4c40d352954510b71de4ff05d78259c721ed
/frameworks/base/core/java/android/content/pm/PackageParser.java
1616f30b0ca1221c7f60a6ae4e90562340c549a9 29-May-2015 dcashman <dcashman@google.com> Add keyset support for ECDSA public keys.

Bug: 21363613
Change-Id: If9eafc725dec4800276251722a7456382dfe207d
/frameworks/base/core/java/android/content/pm/PackageParser.java
597ad3fb51accb68a8e61351421a0ed1d6c29869 10-Jun-2015 Yao Chen <yaochen@google.com> Copy lockTaskLaunchMode from target activity to its alias.

Bug: 21675800
Change-Id: I518f71d57b0a113797fb3879b776cc7142351218
/frameworks/base/core/java/android/content/pm/PackageParser.java
d70b9e7aea9c7b0691f3ac1326752f91d5049458 27-May-2015 Alan Viverette <alanv@google.com> Move ApplicationInfo hardware acceleration to public flags

Bug: 21342038
Change-Id: I5af826f3f2921eef24725c909304243c67f3da78
/frameworks/base/core/java/android/content/pm/PackageParser.java
5db0cd49e8553f45deec6e3db7ec84a5c78ee228 23-May-2015 dcashman <dcashman@google.com> Set error code on failed keyset manifest parsing.

Bug: 21403585
Change-Id: I6f8e0766d373b1b0451b2abef7af6cbb089e4e0c
/frameworks/base/core/java/android/content/pm/PackageParser.java
303650c9cdb7cec88e7ec20747b161d9fff10719 18-Apr-2015 Matthew Williams <mjwilliams@google.com> Add full backup criteria to android manifest

BUG: 20010079
Api change: ApplicationInfo now has a fullBackupContent int
where -1 is (off) 0 is (on) and >0 indicates an xml
resource that should be parsed in order for a developer
to indicate exactly which files they want to include/exclude
from the backup set.
dd: https://docs.google.com/document/d/1dnNctwhWOI-_qtZ7I3iNRtrbShmERj2GFTzwV4xXtOk/edit#heading=h.wcfw1q2pbmae

Change-Id: I90273dc0aef5e9a3230c6b074a45e8f5409ed5ce
/frameworks/base/core/java/android/content/pm/PackageParser.java
e31b820dad4c5f2b19ee10479a675a139ad3c61e 30-Apr-2015 Jeff Sharkey <jsharkey@android.com> New "frozen" state during app move/upgrade.

This replaces mOperationPending, which was in an odd place. It adds
a new PackageSetting.frozen flag that is a last-ditch effort to
prevent ActivityManager from starting an app while it's being moved
or upgraded.

Also provides clearer guarding around all upgrades by freezing,
killing, upgrading, then unfreezing.

Bug: 20275579
Change-Id: I28bb0359a6f4e05080fb336b18dd2a249509d989
/frameworks/base/core/java/android/content/pm/PackageParser.java
6dfdfd6741c5a3dd8d8a49ddbd6ee5dfe2fd292d 15-Apr-2015 Wale Ogunwale <ogunwale@google.com> Added attribute showForAllUsers that deprecates showOnLockScreen

The new name is more meaningful to what the attribute actually does.

Also, force the FLAG_SHOWN_WHEN_LOCKED flag for windows that belong
to acitivties with the showForAllUsers attribute set.

Bug: 20227306
Change-Id: Ifd49166c3ec0e67ae43addc0fb30038523332ea5
/frameworks/base/core/java/android/content/pm/PackageParser.java
15df08abd8190353e1430f88c2ed6462d72a5b25 01-Apr-2015 Craig Mautner <cmautner@google.com> Introduce android:lockTaskMode

The ability for tasks to be started in locktask mode or pinned is
dependent on the value of android:lockTaskMode for the root activity
of the task.

For bug 19995702

Change-Id: I514a144a3a0ff7dbdd4987da5361b94bdfe9a437
/frameworks/base/core/java/android/content/pm/PackageParser.java
1742cfbd8a1458e66f98a56f359590ce3263e161 15-Apr-2015 Amith Yamasani <yamasani@google.com> Always set the dataDir for the given userId

Don't try to optimize for userId != 0 when generating the
ApplicationInfo.

Change-Id: I2eb2d43f36677a781643a1e86a19c8850d517411
/frameworks/base/core/java/android/content/pm/PackageParser.java
b9f3674c11ed9c89b80a69f728cbc5f540b2ecde 09-Apr-2015 Jeff Sharkey <jsharkey@android.com> Support moving apps to expanded storage.

Start deriving the data path for apps based on the volume UUID where
the app lives. This path is used for all higher-level APIs, giving
us a clean place to switch app storage.

When parsing a package, keep track of the volume UUID where it lives
and update PackageSetting once installed. For now continue treating
moves as installs, but we'll eventually clean this up to avoid the
additional dexopt pass. Wire up move to use the new installd command
to move private data between devices.

Cache LoadedApk only for the current user, since otherwise the data
dir points at the wrong path.

Bug: 19993667
Change-Id: I53336e3b147d5fd3130e6800869af172b628da37
/frameworks/base/core/java/android/content/pm/PackageParser.java
e48c137acdddd477d671417eb93ec120a1931cbb 10-Apr-2015 Fabrice Di Meglio <fdimeglio@google.com> Add IntentFilter auto verification - part 5

- optimize IntentFilter verification: dont do stuff we dont want
if we dont need to do them.

- improve IntentFilter candidates filtering and also improve
at the same time fix for bug #20128771: we can return the candidates
list rigth the way if the Intent is not related to a Web data URI and
include the "undefined verification state" ones if the first filtering
pass does not leave any.

Change-Id: I19f5c060f58b93530e37b4425d19ed23d2a0f4c0
/frameworks/base/core/java/android/content/pm/PackageParser.java
7d014cec63939f7aca2a8014f45cd4c9a3e1aa0c 09-Apr-2015 Fabrice Di Meglio <fdimeglio@google.com> Add IntentFilter auto verification - part 4

- add domain verification priming at boot when the PackageManagerService
singleton is created. This will mainly set the domain verification status
to INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS for all Apps that
have an IntentFilter with action VIEW and data scheme HTTP or HTTPS.

- also optimize Intent resolution by taking into account Browser Apps

Change-Id: Id8e66c9759a99e79b07051595ca89a168dc5ae0e
/frameworks/base/core/java/android/content/pm/PackageParser.java
cd890311fb5d8240fb3df703befa202efe0ff60c 08-Apr-2015 Svetoslav <svetoslavganov@google.com> Merge "Apps can request permissions only on platforms that have runtime permissions."
96a77167c8247d3128efbd4a9456a49845bdb9cf 03-Apr-2015 Svetoslav <svetoslavganov@google.com> Apps can request permissions only on platforms that have runtime permissions.

Change-Id: Id0e53c37c9d472287f5bd6a610d446aef6b695b9
/frameworks/base/core/java/android/content/pm/PackageParser.java
b2b9ab8354da1485178cd8d8e9d89ac915b3f269 06-Apr-2015 Jeff Sharkey <jsharkey@android.com> Installing packages to expanded storage.

PackageManager now offers to load/unload packages when expanded
volumes are mounted/unmounted. Expanded storage volumes are still
treated as FLAG_EXTERNAL_STORAGE from a public API point-of-view,
but this change starts treating the INSTALL_EXTERNAL flag as
exclusively meaning ASEC containers.

Start tracking the UUID of the volume where a package is installed,
giving us a quick way to find relevant packages. When resolving an
install location, look across all expanded volumes and pick the one
with the largest free space. When upgrading an existing package,
continue preferring the existing volume. PackageInstaller now knows
how to stage on these volumes.

Add new movePackage() variant that accepts a target volume UUID
as destination, it will eventually move data too. Expose this
move command through "pm" command for testing.

Automount expanded volumes when they appear.

Bug: 19993667
Change-Id: I9ca2aa328b9977d34e8b3e153db4bea8b8d6f8e3
/frameworks/base/core/java/android/content/pm/PackageParser.java
96bba82ac4295f68ef956ecae7ee169eb3c271d1 03-Apr-2015 Fabrice Di Meglio <fdimeglio@google.com> Merge "Add private flag PRIVATE_FLAG_HAS_DOMAIN_URLS to ApplicationInfo"
d3d8a32217d5a2d895917cfe7e1645935d228494 02-Apr-2015 Fabrice Di Meglio <fdimeglio@google.com> Add private flag PRIVATE_FLAG_HAS_DOMAIN_URLS to ApplicationInfo

This is for supporting Settings UX and Domain URLs

- the new PRIVATE_FLAG_HAS_DOMAIN_URLS flag will be set by
generateApplicationInfo() when the Activity is said to have some
IntentFilter with a VIEW action and a http / https data URI

- code cleaning for args passing
- also add a new constant for the MetricsLogger

Change-Id: I5c9762fc2c4a9b46c0e255b9a23bffd70fae40c7
/frameworks/base/core/java/android/content/pm/PackageParser.java
c38a54b1f076b86453041755e15504fd0b4d48af 03-Apr-2015 Fyodor Kupolov <fkupolov@google.com> am 30c688da: am 031898df: am 3d8b7f4d: Merge "Support for storing OAT files in app directory"

* commit '30c688da8bd2b3320446a06424e1cc57b693522a':
Support for storing OAT files in app directory
6cd6cec2adae647ca6ec3aa7ef3288cbb1f814b1 01-Apr-2015 Craig Mautner <cmautner@google.com> Revert "Add lockTaskOnLaunch attribute."

This reverts commit 0fb1cb56abf708291c09c783463408c7074ae9a7.
/frameworks/base/core/java/android/content/pm/PackageParser.java
0fb1cb56abf708291c09c783463408c7074ae9a7 31-Mar-2015 Craig Mautner <cmautner@google.com> Add lockTaskOnLaunch attribute.

The new AndroidManifest activity attribute, lockTaskOnLaunch attribute
is a boolean that puts the system in lockTask mode when true and if
the activity specified is the root of a privileged task.

This bug also fixes lockTask mode for root activities that finish
themselves. Previously finish was not allowed even if there were
activities left in the task that were still valid.

A NullPointerException for lock task toasts has also been fixed.

Fixes bug 19995702.

Change-Id: Iba6976b1a0cc5a22eb526db66d2e9af66445541f
/frameworks/base/core/java/android/content/pm/PackageParser.java
b12dcfb1b12c13e01743567145f01e7d389afdbb 30-Mar-2015 Narayan Kamath <narayan@google.com> Remove org.apache.http.legacy for declared shared lib lists.

We currently unconditionally include this shared library in the
boot classpath, so attempts to compile it will fail resulting in
unnecessary logspam.

Change-Id: Iafe9b2e725e10d939cd39dd4a816a146a6031baf
/frameworks/base/core/java/android/content/pm/PackageParser.java
b94c1657eb0140f7b91f5372a9f76de5a3d87e36 03-Mar-2015 Fyodor Kupolov <fkupolov@google.com> Support for storing OAT files in app directory

In installPackageLI, dexopt is now performed on a staging directory of the app
(dexopt phase 1). For each codepath:
- /oat/<isa> directory is created
- dexopt output goes to the newly created directory. Optimized files have
.odex extension.

Bug: 19550105
Change-Id: Iec59790d97837b78af82b079fd1970de3388c91d
/frameworks/base/core/java/android/content/pm/PackageParser.java
1c1b47125da018b44240739db75f8898e064a948 20-Nov-2014 Fabrice Di Meglio <fdimeglio@google.com> Add IntentFilter auto verification

The purpose of this feature is to prompt the Disambiguation dialog
to Users as less as possible.

- add the new "autoVerify" property to the IntentFilter class
- add new APIs to PackageManager:
verifyIntentFilter(int, int, List<String>),
getIntentVerificationStatus(String, int),
updateIntentVerificationStatus(String, int, int),
getIntentFilterVerifications(String)
for supporting IntentFilter verification
- add support for multi-user
- update PackageManager for IntentFilter verification:
basically when we are installing a new package, ask for verification
of all domains from the IntentFilters that have the "autoVerify" to true.
This means that the PackageManager will send a well defined protected
broadcast (with a new INTENT_FILTER_NEEDS_VERIFICATION action) to
an IntentFilter verifier to do the real job of verification.
We are passing in the broadcast Intent all the necessary data for
doing the verification. The PackageManager will receive as response
the result code of the domain verifications and, if needed, the list
of domains that have failed the verification.
- add a new INTENT_FILTER_VERIFICATION_AGENT permission that needs to
be set by an intent filter verifier to be considered as a trustable
party by the PackageManager.
- add also a new BIND_INTENT_FILTER_VERIFIER permission for securing
the binding between the PackageManager and a service doing the
intent filter verifications.
- add ResolveInfo filterNeedsVerification which is a boolean
to knows if the IntentFilter is of a type that needs a verification
(action VIEW, category BROWABLE, HTTP/HTTPS data URI)
- add new "domain-preferred-apps" / "d" dump command for listing the
prefered Apps for all domains
- add new "intent-filter-verifiers" / "ivf" command for listing the
IntentFilterVerifier used
- introduce the IntentVerificationService which is a basic service
for verifying IntentFilters. This service will send HTTPS requests
to the domain declared in the IntentFilter(s) for doing the
verification. This service has a low priority level so that it
can be replaced by a more sophisticated one if needed. This service
is updating the PackageManager intent verification states thru
the updateIntentVerificationStatus(...) API.
- update MockPackageManager

Change-Id: I0bfed193d0bf1f7c7ac79f6c1b160b7ab93b5fb5
/frameworks/base/core/java/android/content/pm/PackageParser.java
3695b8a1488a6cc331feba1c2ab359888656bf7c 25-Mar-2015 Svet Ganov <svetoslavganov@google.com> First implementation of the grant/revoke UI

Change-Id: Icdb7c822881552b30850697dba709671bf27baa5
/frameworks/base/core/java/android/content/pm/PackageParser.java
6a225edccda80b38f4d249d9befdbcf0769c0446 24-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Merge "Load libraries directly from apk"
c6d1c345f41cf817bf2c07c97b97107d94296064 26-Feb-2015 Svetoslav <svetoslavganov@google.com> Runtime permissions: per user permission tracking.

Before all permissions were granted at install time at once, so the user
was persented with an all or nothing choice. In the new runtime permissions
model all dangarous permissions (nomal are always granted and signature
one are granted if signatures match) are not granted at install time and
the app can request them as necessary at runtime.

Before, all granted permission to an app were identical for all users as
granting is performed at install time. However, the new runtime model
allows the same app running under two different users to have different
runtime permission grants. This change refactors the permissions book
keeping in the package manager to enable per user permission tracking.

The change also adds the app facing APIs for requesting runtime permissions.

Change-Id: Icbf2fc2ced15c42ca206c335996206bd1a4a4be5
/frameworks/base/core/java/android/content/pm/PackageParser.java
e7666f9e45461111a5ff2da67ad8ecc9ab740d1f 23-Mar-2015 Wale Ogunwale <ogunwale@google.com> Merge "Default ActivityInfo.resizeable to false for all SDK versions."
ff193d642eea7128faad837d19e347cd25212c27 01-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Load libraries directly from apk

Introduced new 'extractNativeLibs' attribute to manifest/application.
Setting it to false prevents installer from extracting library from apk.

The default value for extractNativeLibs is true.

Bug: 8076853
Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
/frameworks/base/core/java/android/content/pm/PackageParser.java
abfcc22ddf3010ca06b979d3bd0f03ebcf854631 20-Mar-2015 Wale Ogunwale <ogunwale@google.com> Default ActivityInfo.resizeable to false for all SDK versions.

Bug: 19347452
Bug: 19865400
Change-Id: I2afbcdb9c876c756b14068efc750093057f0b865
/frameworks/base/core/java/android/content/pm/PackageParser.java
160a253d48d81066c7dfaf7e21aca63942df75b8 19-Mar-2015 Alex Klyubin <klyubin@google.com> am d71f548f: am 4177b8cb: Merge "Add app-level usesCleartextTraffic manifest attribute."

* commit 'd71f548f4803f0696af7de9a2989673cfd83800f':
Add app-level usesCleartextTraffic manifest attribute.
9b0ab65ed46be992dd71b5f811bb972168e51c36 18-Mar-2015 Alan Viverette <alanv@google.com> Enable/disable hardware rendering on windows by application tag

Previously, hardware rendering cannot be enabled or disabled
on windows created without a parent activity (e.g. by services)
by setting the <application> tag, "android:hardwareAccelerated"
in AndroidManifest.xml. It's enabled by default in Android L
from the commit, 5e1565ead6dbb7d5c414522591f61b16a23de1c3.
This patch provides a way of setting hardware rendering for
that case.

Change-Id: I60ee9566e99db39cd661fe6f196f43c3968b311a
Signed-off-by: Dohyun Lee <dohyun.lee@lge.com>
/frameworks/base/core/java/android/content/pm/PackageParser.java
01a959d60a2c5f04ab240513a853d7845b3a309e 18-Mar-2015 Alex Klyubin <klyubin@google.com> Add app-level usesCleartextTraffic manifest attribute.

The attribute declares whether the app intends to use cleartext
network traffic (e.g., HTTP, WebSockets, XMPP, SMTP, IMAP -- without
TLS or STARTTLS). The default value is true. If set to false, the app
declares that it does not intend to use cleartext network traffic. In
this case the app requests the platform, tooling, and third-party
libraries to prevent it from using cleartext traffic. The danger of
cleartext network traffic is that its confidentiality, authenticity,
and integrity are not guaranteed.

This feature is designed to help apps which care about security of
data exchanged over the network. These apps can accidentally
regress/downgrade to using cleartext network communications. This
typically happens when the server the app communicates with all of a
sudden tells it to use cleartext communications (e.g, HTTP URL
instead of an HTTPS URL) or when one of the components of the app gets
updated and regresses to cleartext communications without the
developer noticing.

In general, the prevention measures are on best effort basis. It's
impossible to automatically prevent all instances of cleartext
traffic. For example, an app bent on bypassing restrictions could
perform low-level network I/O with unusual TCP packet fragmentation,
or could use a custom application-level protocol.

The expectation is that most apps use libraries for network
communications and these libraries over time will start to honor this
flag, thus increasing the protections offered by it.

Bug: 19215516
Change-Id: I8700d51ddbc5d528faa4b6a5fa5bc9551ad02d13
/frameworks/base/core/java/android/content/pm/PackageParser.java
7487657ee9f3f91a1fb4e52ce2a03b56496ac1f4 24-Feb-2015 Fyodor Kupolov <fkupolov@google.com> Extracted a separate class to run dexopt on packages

performDexOptLibsLI and related methods were extracted to PackageDexOptimizer
class. Minor refactoring of PackageManagerService.

This is a non-functional change. It should simplify further work to allow
storing OAT files inside package dir.

(cherry picked from commit eeea67b8c3678d882d3774edc41242c63daa60fa)

Change-Id: I3494a2da70605362bb6fb4625ffbee1cbe1cd457
/frameworks/base/core/java/android/content/pm/PackageParser.java
eeea67b8c3678d882d3774edc41242c63daa60fa 24-Feb-2015 Fyodor Kupolov <fkupolov@google.com> Extracted a separate class to run dexopt on packages

performDexOptLibsLI and related methods were extracted to PackageDexOptimizer
class. Minor refactoring of PackageManagerService.

This is a non-functional change. It should simplify further work to allow
storing OAT files inside package dir.

Change-Id: I3494a2da70605362bb6fb4625ffbee1cbe1cd457
/frameworks/base/core/java/android/content/pm/PackageParser.java
05ecfd308d983755bc7cab39ba99a37c321f176b 11-Feb-2015 Alex Klyubin <klyubin@google.com> am 33d3c53d: resolved conflicts for merge of 517e0274 to lmp-mr1-dev-plus-aosp

* commit '33d3c53da021f0d044028860ace0f4ad817273f5':
Move hidden ApplicationInfo flags into a separate field.
33d3c53da021f0d044028860ace0f4ad817273f5 11-Feb-2015 Alex Klyubin <klyubin@google.com> resolved conflicts for merge of 517e0274 to lmp-mr1-dev-plus-aosp

Change-Id: Ic20b6c8851458483dd73a144bd5ae6e8d141e62a
b9f8a5204a1b0b3919fa921e858d04124c582828 03-Feb-2015 Alex Klyubin <klyubin@google.com> Move hidden ApplicationInfo flags into a separate field.

The public API field android.content.pm.ApplicationInfo.flags can
support only 32 flags. This limit has been reached. As a short term
workaround to enable new public flags to be added, this CL moves flags
which are not public API into a separate new field privateFlags and
renames the affected flags constants accordingly (e.g., FLAG_PRIVILEGED
is now PRIVATE_FLAG_PRIVILEGED).

The new privateFlags field is not public API and should not be used
for flags that are public API.

The flags that are moved out of ApplicationInfo.flags are:
* FLAG_HIDDEN,
* FLAG_CANT_SAVE_STATE,
* FLAG_FORWARD_LOCK, and
* FLAG_PRIVILEGED.

NOTE: This changes the format of packages.xml. Prior to this CL flags
were stored in the "flags" attribute. With this CL, the public flags
are stored in a new "publicFlags" attribute and private flags are
stored in a new "privateFlags" attribute. The old "flags" attribute
is interpreted by using the old values of hidden/private flags.

Change-Id: Ie23eb8ddd5129de3c6e008c5261b639e22182ee5
/frameworks/base/core/java/android/content/pm/PackageParser.java
a928127a74d6ffe9334774e64a4470aedbe6c28b 07-Feb-2015 Wale Ogunwale <ogunwale@google.com> Set TaskStack config orientation based on dimensions

The TaskStack override configuration is set based on the
stack dimensions so we can load the most acturate resources
for activities in the stack in a multi-window environment.

Also, disabled fixed screen orientation for resizeable
activities.

Bug: 19305402
Change-Id: I7b182554523b12f2ef77f8bbc7b16891231125bf
/frameworks/base/core/java/android/content/pm/PackageParser.java
e2d2ed49235d2f717f0aee1d2c6671b376700b62 13-Jan-2015 Narayan Kamath <narayan@google.com> Conditionally include org.apache.http.legacy in app classpaths.

bug: 18027885

Change-Id: Id330ffde9d2a6e516fd60edc33f5529df719c634
/frameworks/base/core/java/android/content/pm/PackageParser.java
9d3de4cfb42519fefe9d8b03c38ba440bd6bc886 02-Feb-2015 Wale Ogunwale <ogunwale@google.com> Support for activity to opt-in/out of resizeable/multi-window support.

Bug: 19178148
Change-Id: I5819a71cdc48e0af4add11a6d4a503ec5cbe5d63
/frameworks/base/core/java/android/content/pm/PackageParser.java
703d1c43a25fe6e80c5fea46cc0ff14f0e1fbc00 27-Jan-2015 Fyodor Kupolov <fkupolov@google.com> Added primaryUserOnly attribute for activities

In addition to receivers, primaryUserOnly is now supported for activities.

In queryIntentActivities method, activities with primaryUserOnly flag set will
be filtered out, when current user is not the owner.

Change-Id: I0b7168b8c96749cd6d23b8c95d5624589f5f2d86
/frameworks/base/core/java/android/content/pm/PackageParser.java
1bc177c58550514c6e48d74061392b4247a9bf6a 03-Dec-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17948584: Application crash and phone restart when app...

...is installed with <provider> with empty string.

Don't allow empty authorities, just like we don't allow null authorities.

Change-Id: I5c64592a639efe4dba848bd6f0efe4257f1565a2
/frameworks/base/core/java/android/content/pm/PackageParser.java
88d2a3c0e1b4a8c53a489db5d627beb80b1b9957 23-Nov-2014 Jeff Sharkey <jsharkey@android.com> Introduce revision codes for split APKs.

Apps delivered as multiple split APKs must have identical package
names, version code, and signatures. However, developers may want
to iterate quickly on a subset of splits without having to increment
the version code, which would require delivery of the entire app.

This change introduces "revision codes" which can vary between
split APKs belonging to the same app. An install is valid as long
as the normal version code is identical across all splits. Splits
can be added/removed to an app over time, but if a split is present
across an upgrade the revision code must not decrease.

Since system apps could have been updated with splits, only revert
to the built-in APKs if the version code is strictly greater than the
data version. Also fix bug to enable inheriting from system apps
when adding splits.

Bug: 18481866
Change-Id: I34d8e14c141a8eb95c33ffe24b4e52d6af5c8260
/frameworks/base/core/java/android/content/pm/PackageParser.java
9f837a99d48c5bb8ad7fbc133943e5bf622ce065 24-Oct-2014 Jeff Sharkey <jsharkey@android.com> Reduce PackageManager RAM usage: ArrayMap/Set.

Transition PackageManager internals away from heavier HashMap/HashSet
to use drop-in ArrayMap/ArraySet replacements. Saves ~38% RAM and
thousands of objects on a typical device.

Bug: 18115729
Change-Id: Ie107d2fee4b7baa4e3c3923231b4be877d1a5d2f
/frameworks/base/core/java/android/content/pm/PackageParser.java
dbfbb17512fe6a5b3c7198d60b6a149969174a71 30-Sep-2014 Jeff Hao <jeffhao@google.com> Backport of ordering apps for boot dexopt.

This is a squashed commit of the following changes:

1. Order apps by priority when performing boot dexopt.
(cherry picked from commit 65cde7d42d741c7d9aa2714a397b7333f688ab55)

2. Improve priority ordering of apps when performing boot dexopt.
Added core apps and updated system apps.
(cherry picked from commit 272bf3a274daff62995caf05da338c1f2a73dae3)

3. Stop boot dexopt when low on memory.
(cherry picked from commit 1d892dcb6b0ff3a50cc63e387667dc29baf1014f)

Bug: 17641843
Change-Id: Ie32f1c21047d3462aaf728f7633fecf647ba2b47
/frameworks/base/core/java/android/content/pm/PackageParser.java
272bf3a274daff62995caf05da338c1f2a73dae3 08-Oct-2014 Jeff Hao <jeffhao@google.com> Improve priority ordering of apps when performing boot dexopt.

Added core apps and updated system apps.

Bug: 17641843
Change-Id: Ia00ea3399cf1e1acaef45ff8df8f754442de5185
/frameworks/base/core/java/android/content/pm/PackageParser.java
ace27915d2cc5073bcbe9cc151a5c61683bdcd1a 19-Sep-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17564607: Apps in the managed profile can send any intent...

...to the primary user, even if it was not whitelisted to be forwarded.

The path where getActivityInfo is called for the ResolverActivity
would not correctly apply the requested user ID to the result, so
it wouldn't run under the correct user.

Change-Id: I1da47c54bbed26091832a28236d0b06762c92437
/frameworks/base/core/java/android/content/pm/PackageParser.java
8307ea701c8a06378bd31148bcbe4d312af2b31a 12-Sep-2014 Craig Mautner <cmautner@google.com> If activity is an alias get maxRecents from target

Activity aliases do not pick up values in the PackageParser. The
actual values should come from the target activity instead.

Also ActivityInfo now propagates maxRecents in copy constructor
and across Binder calls (via parcelling).

Fixes bug 17391328.

Change-Id: I35d248032eca7557528c9d499b3b38f27c713d09
/frameworks/base/core/java/android/content/pm/PackageParser.java
bc09755e193c2802d2d88871ac3d1f182b260c30 09-Sep-2014 Jeff Sharkey <jsharkey@android.com> Missing manifest error should be NO_CERTIFICATES.

When META-INF/MANIFEST.MF is missing, treat as NO_CERTIFICATES
instead of CERTIFICATE_ENCODING. Also remove redundant layer of
debugging details when wrapping exceptions.

Bug: 15667982
Change-Id: I6e8216d5bf6e42da1feb70c89f991001380305be
/frameworks/base/core/java/android/content/pm/PackageParser.java
a4e102ee580282dc7abeb22f4a025813e53b9431 05-Sep-2014 Dianne Hackborn <hackbod@google.com> Work on issue #17357238: Recents is often slow if not used in a while

Add a new activity attribute, resumeWhilePausing, that allows an
activity specifying it to immediately start running without waiting
for the previous activity to pause. The recents activity is updated
to use this.

The implementation of this is ultimately fairly simple -- if we are
in the path of resuming such an activity, and find that we first need
to pause the existing activity, then within the activity manager we
do the regular pause flow but act like it has immediately finished
pausing right then so that we can immediately go on to the resume.
To make this clean, we tell the activity when asking it to pause that
it should not come back and tell us it is done, because we aren't in
any way waiting for it.

One potentially important change I needed to make here is the pause
callback no longer provides the saved persistent state, because we
now can't count on that callback happening. I don't think there was
really any utility in this anyway -- all modern apps will have their
save state flow happen as part of stopping, not pausing, so we'll
only capture that saved state when the stop is reported back anyway.
And since we do send the saved state back when stopping, it would
always blow away whatever we had gotten at the pause.

Finally, update the documentation for AppTask.startActivity(), and
fix the implementation handling that to be cleaner -- we need to
deal with inTask first before getting in to "oh noes add NEW_TASK
if this isn't coming from a calling activity" flow.

Change-Id: Ia1da0fac90d7bdbaafdda2e34850d795ce17a39f
/frameworks/base/core/java/android/content/pm/PackageParser.java
852975d5377bfe5f4abc9d2a28e301aa2fa99994 23-Aug-2014 Dianne Hackborn <hackbod@google.com> Fix issue #17179314: Make recents limits consistent

The max limit is now 100 (or 50 on svelte devices), and that is
what everyone used.

Re-arranged things so we have a big expensive "fix the world!"
function for recents that we go in to at only select points:
when first initializing the system, when external storage comes
and goes, and if we detect something wrong with the recents
structure.

With that, now getRecentTasks() and addRecentTaskLocked() are
generally much simpler, doing very little work in most cases.
This will help a lot with scaling up to many more recents
entries.

Change-Id: I7b5ae89edc06568f68c8af54a4420aff7635581c
/frameworks/base/core/java/android/content/pm/PackageParser.java
6b2416492e78b8f8d7bcff58cbd2015e9b0ef59c 25-Aug-2014 Adam Lesinski <adamlesinski@google.com> Merge "PM: Load all splits when parsing an app manifest" into lmp-dev
3bcbd906bcf76267d7413297b9748c2cac0f9b82 23-Aug-2014 Adam Lesinski <adamlesinski@google.com> PM: Load all splits when parsing an app manifest

Previously the base APK would be considered without
any splits loaded into the same AssetManager. This would
prevent splits from overriding attributes in the
AndroidManifest.xml, such as enabled state based on
version, etc.

This CL loads all APKs in the cluster into a common AssetManager
from which the base AndroidManifest.xml is parsed.

Bug:17006358
Change-Id: Ib88096c49d0c4f743b7e6ba0921251459bee107c
/frameworks/base/core/java/android/content/pm/PackageParser.java
941a8ba1a6043cf84a7bf622e44a0b4f7abd0178 21-Aug-2014 Jeff Sharkey <jsharkey@android.com> Installing splits into ASECs!

Sessions can now zero-copy data directly into pre-allocated ASEC
containers. Then at commit time, we compute the total size of the
final app, including any inherited APKs and unpacked libraries, and
resize the container in one step.

This supports both brand new ASEC installs and inheriting from
existing ASEC installs. To keep things simple, it currently requires
copying any inherited ASEC contents, but this could be optimized in
the future.

Expose new vold resize command, and allow read-write mounting of ASEC
containers. Move native library extraction into the installer flow,
since it needs to happen before ASEC is sealed. Move multiArch flag
into NativeLibraryHelper, instead of making everyone pass it
around. Migrate size calculation to shared location.

Separate "other" package name in public API, provide a path to a
storage device when relevant, and add more docs.

Bug: 16514385
Change-Id: I06c6ce588d312ee7e64cce02733895d640b88456
/frameworks/base/core/java/android/content/pm/PackageParser.java
bb7b7bea19223c1eba74f525c7fe87ca3911813b 20-Aug-2014 Jeff Sharkey <jsharkey@android.com> More progress towards split APKs in ASECs.

Teach DefaultContainerService to install split APKs, which will be
needed when moving to/from ASECs. Also support forward locking for
testing purposes, even though its deprecated.

Move native library unpacking code to NativeLibraryHelper location
where it can be shared by both DCS and PMS. Also update footprint
calculation logic to mirror the later unpack codepaths.

Immediately persist sealed sessions. When resolving install
locations, prefer location of any existing install of that
package. Lightweight parse requesting certificates now always
verifies that all contents are signed correctly.

Bug: 16514385
Change-Id: Ida1c4eb0f95b065104dd971e19126d4085ebf1f0
/frameworks/base/core/java/android/content/pm/PackageParser.java
6d248493878b1280e13be82e3e02a5ea42949555 24-Apr-2014 Nicolas Prévot <nprevot@google.com> Revert "Adding the requiredForProfile flag."

This reverts commit 531270a4a177a9f245d328d9467c6d1adbd5354a.

BUG: 17102702

Change-Id: Iec5d047dc74bd4899662ede82c48fc024238427c
/frameworks/base/core/java/android/content/pm/PackageParser.java
d3edfde51bd069a63e820282421d1a534fcf00ce 09-Aug-2014 Adam Lesinski <adamlesinski@google.com> Add FeatureGroup to PackageInfo

FeatureGroups replace top-level FeatureInfo objects.
FeatureGroups inherit top-level FeatureInfos but override
them if the feature names are the same.

Bug:16822121

Change-Id: I80b2cb778a0fbcb4521efce986fba641e0914290
/frameworks/base/core/java/android/content/pm/PackageParser.java
4903f64ba2478849e6c401f42f5a77c1d4f9f7df 11-Aug-2014 Narayan Kamath <narayan@google.com> Persist the cpuAbiOverride setting.

If an app is installed with an ABI override (adb install -r --abi)
we should remember this so that we don't revert to the scan derived
ABI on the next reboot.

bug: 16476618

Change-Id: I6085bc0099eb613dd9d3b07113c7c13859780697
/frameworks/base/core/java/android/content/pm/PackageParser.java
2c72b6822debb08fe997926eedc110f62d287d34 24-Jun-2014 Adam Lesinski <adamlesinski@google.com> Add <feature-group> tag and change aapt badging

A <feature-group> represents a set of features required
for an app to be compatible with a device. Multiple
<feature-group> elements represent a logical 'or'
of required features.

Features defined in the old way with <uses-feature> tags
under the <manifest> tag are automatically added to each
feature-group defined.

Defining a <feature-group> means that any default
features are not included (such as android.hardware.touchscreen)
and declared permissions do not imply any features.

Change-Id: I45626f0fdc546e47bcf2aead7ef05ebcca12b023
/frameworks/base/core/java/android/content/pm/PackageParser.java
e5bcff624fb58b6f95be8ddff7f5b6b3bf5d19c7 20-Jul-2014 Amith Yamasani <yamasani@google.com> Rename setApplicationBlocked to setApplicationHidden

This corrects the expected behavior of the app state. Hidden apps
can be installed by the store to be brought out of hidden state.

Bug: 16191518
Change-Id: Id128ce971ceee99ba1dea14ba07ce03bd8d77335
/frameworks/base/core/java/android/content/pm/PackageParser.java
7df3625d5bb28d11cce9ac23429f5e3c6ebac030 16-Jan-2014 Martin Kosiba <mkosiba@google.com> Allow for appending of resources to an AssetManager.

BUG: 11505352
Change-Id: Ifa290580a6dc63c2f471d0bbf5f066db14aed4d7
/frameworks/base/core/java/android/content/pm/PackageParser.java
2053168eb4506e2f8795afdbe9731c6451e1589c 14-Jul-2014 Narayan Kamath <narayan@google.com> Dexopt for Context.createPackageContext when code is included.

The package manager now keeps track of per ISA dex-opt state.

There are two important things to keep in mind here :

- dexopt can potentially be very slow. In cases where the target
package hasn't been dexopted yet, this can take multiple seconds
and may cause an ANR in the caller if the context is being
created from the main thread.
- We will need to remove the constraint that dexopt can only be
requested by the system (or root). Apps will implicitly be
requesting dexopt by asking for package contexts with code included.
It's important to note that unlike dalvik, the dexopt stage in ART
isn't optional. ART cannot load classes directly from dex files.

bug: 15313272
Change-Id: I0bd6c323a9c1f62f1c08f6292b7f0f7f08942726
/frameworks/base/core/java/android/content/pm/PackageParser.java
78a130144bdd047665f00782c481d31edb3e5fb7 16-Jul-2014 Jeff Sharkey <jsharkey@android.com> Mark resource-only splits as hasCode=false.

PackageManagerService now skips dexopt for split APKs that don't
declare they have code. Also surface more detailed error messages
in logs.

Bug: 14975160
Change-Id: Ie6078dba724815020cee59b7fc52317e88ca097a
/frameworks/base/core/java/android/content/pm/PackageParser.java
da96e137bcc8191c584ada7b5de31eaae92f244f 15-Jul-2014 Jeff Sharkey <jsharkey@android.com> Parse more split APK manifest details.

Allow split APKs to define activities, services, receivers,
providers, and metadata. However, support for many manifest items
are explicitly omitted.

Only dexopt split APKs that include code.

Bug: 14975160
Change-Id: I2fbf99e2a62328aa2185e5924755af33060282fc
/frameworks/base/core/java/android/content/pm/PackageParser.java
a8755a8407d1583425cd9e69fb580bba26a66041 15-Jul-2014 Narayan Kamath <narayan@google.com> Fix multiArch parsing for ApkLite.

Two separate issues :
- We were not parcelling the value at all.
- We were looking for it in the wrong manifest attribute.

Note that this change has no observable effect on installs (which
is probably why it wasn't caught so far). This code path is only
used in FileInstallArgs.copyApk (where multiArch was effectively
false before this change) but the package manager extracts shared
libs *again* inside scanPackageLI where this was being done
correctly since the value there came from a "full" package
parse, and not a "lite" package parse.

Change-Id: I54c3efcf8f57e6970f8fbde8cd1f57d487b13114
/frameworks/base/core/java/android/content/pm/PackageParser.java
6c833e07a05c48ca60ee4d72421bf8b1e78dc710 15-Jul-2014 Jeff Sharkey <jsharkey@android.com> Public API for PackageInstaller!

Flesh out documentation and finalize first cut of API. Also surface
installLocation and splitNames through PackageInfo.

Bug: 14975160, 15348430
Change-Id: Ic27696d20ed06e508aa3526218e9cb20835af6a0
/frameworks/base/core/java/android/content/pm/PackageParser.java
e0b0bef75b66f0a87039c8f58c17b1596a2baebe 13-Jul-2014 Jeff Sharkey <jsharkey@android.com> Surface detailed error messages from PMS.

We now both log detailed error messages and relay them back to any
observer. Start refactoring PMS to throw when errors are encountered
internally to make it easier to reason about flow control; already
uncovered a few instances of errors being silently ignored!

Change-Id: Ia335c5e31bd10243d52fd735c513ca828e83dca0
/frameworks/base/core/java/android/content/pm/PackageParser.java
84f1294a958b42000755dc6570e3eda72ab42140 11-Jul-2014 Jeff Sharkey <jsharkey@android.com> Always derive native library paths at runtime.

Over time, we've unpacked native libraries at various places with
respect to their source APK. Persisting this path in PackageSettings
has caused more pain recently with the switch to supporting multiArch
and cluster installs.

This change switches us to always derive the native library paths at
runtime based on the type of install. This also ensures that
transitioning between a bundled system app and an upgraded system
app will always build the right path.

We still persist the last generated path into PackageSettings to make
cleanup at uninstall time easier.

Bug: 16208505, 16206748, 16212206
Change-Id: Ieb82a424ca4a92b5674983453c50ba4b695abfb0
/frameworks/base/core/java/android/content/pm/PackageParser.java
989eb371bf8f572fed1e65c6d8aeeb2548be89a7 17-Jun-2014 dcashman <dcashman@google.com> Change key-set/public-key manifest relationship.

Separate definition of public keys and keysets in the manifest to better
represent their relationship. The 'key-set' tags should have nested additional
'public-key' tags that indicate which of the defined 'public-key' tags are
associated with them. The first use of a given 'public-key' name should define
its value; subsequent uses may refer to it only by name. 'key-set' and
'public-key' names may not intersect.

Also, change 'keys' tag to 'key-sets' to avoid issues with previous keysets
implementation.

Bug: 6967056
Change-Id: I7534e4a42326e97b67b55509187c0d3c21a2bb32
/frameworks/base/core/java/android/content/pm/PackageParser.java
ff110bd61a69f7ed8602ae14b27f7befec76b2e7 04-Jul-2014 Narayan Kamath <narayan@google.com> Multi-arch application installs.

Each application now has two ABIs, the primary
and the secondary. The app is always launched with
the primary, but the secondary might be used by other apps
that load the given applications code. This implies we
must:

- dex2oat the app both ways.
- extract shared libraries for both abis.

The former is relatively straightforward but the latter
requires us to change the layout for shared libs that we
unpack from applications. The bulk of this change deals
with the latter.

This change continues to fill in nativeLibraryPath during
scans for backwards compatibility. This will be removed in
a future patch.

Change-Id: Ia943dd11ef815c5cbfc60f17929eaa2a652a385a
/frameworks/base/core/java/android/content/pm/PackageParser.java
ec55ef0934b8e0d1bb705434947de817f7be57f1 08-Jul-2014 Jeff Sharkey <jsharkey@android.com> Extend pm to support sessions and split APKs.

Separate commands to create an install session, stream files into the
staging area, and then commit the install. Streaming can accept data
from stdin across adb, avoiding extra copy from push.

Extend FileBridge to support blocking close(). Always destroy
session regardless of result.

Bug: 14975160
Change-Id: Ic3f462e7d1901079b785e210228950cdfa676466
/frameworks/base/core/java/android/content/pm/PackageParser.java
589a1bc0b00e570db079b4b157f60229ad8ef8f9 03-Jul-2014 Narayan Kamath <narayan@google.com> Add manifest attribute for multiArch apps.

bug: 16013931
Change-Id: Ie8b01d364eed0846deeddf11e0d6e4cc1fba3e61
/frameworks/base/core/java/android/content/pm/PackageParser.java
d746057f2414cba2bdc69257cc5be8cb681bb592 07-Jul-2014 Jeff Sharkey <jsharkey@android.com> Change new file installs to be cluster-based!

Now that all the other pieces are in place, we're ready to start
installing new file-based packages as a cluster (the new unified
directory-based layout). This greatly simplifies the renaming
process.

Also add helper methods to ApplicationInfo to give a much clearer
mapping between it and internal field names, since we can't change
the public API.

Add recursive restorecon().

Bug: 14975160
Change-Id: I72a63c5ddbc594c2fec4a91dd59f73ef253fbfd7
/frameworks/base/core/java/android/content/pm/PackageParser.java
be520fba1e45c77ca20eb66005a0cf19e10939a1 05-Jul-2014 Jeff Sharkey <jsharkey@android.com> Teach DCS about cluster packages.

For the time being, DCS is going to still be doing heavy lifting for
some install tasks, so it need to know how to handle both monolithic
and cluster packages. This change is mostly plumbing work to
eventually handle any various splits APKs that we may encounter.

Bug: 14975160
Change-Id: I39848d5666f9083cb4eca493e5cdaa868f3f99fb
/frameworks/base/core/java/android/content/pm/PackageParser.java
73767b9d607d99b3a027619b5c6b7f1a09b7673d 05-Jul-2014 Jeff Sharkey <jsharkey@android.com> Extract native code from split APKs.

In the new split APK world, multiple APKs work together to define a
single package. This means that native code may be split among those
APKs. To handle this, extend NativeLibraryHelper to examine all
APKs in a package ordered by splitName.

A package has valid native code as long as one matching ABI is found
inside. The "best" ABI found across all APKs is picked for the
entire package. No attempt is made to ensure that every native
library defined is available for the picked ABI; that's the
responsibility of the installer.

Re-introduce PackageLite to represent a lightweight parsing of an
entire package, which may be a single monolithic APK or a cluster
of one or more APKs.

Remove native code extraction from InstallerSession, since it'll be
handled inside PMS for this release.

Bug: 14975160
Change-Id: I4f4db0f82e88a46101c7777499ebc0a11fd911f9
/frameworks/base/core/java/android/content/pm/PackageParser.java
7482a8d08ea1270c8411ecd634eaf7c2a0fda7ee 17-Jun-2014 Marcin Kosiba <mkosiba@google.com> Preload the WebView package into all applications.

This is a temporary workaround to allow the WebView to move into
an APK.

BUG: 11505352
Change-Id: I0c446d44c3f94f70bced7f471ae6fb74f65d5ff9
/frameworks/base/core/java/android/content/pm/PackageParser.java
57dcf5b177b56195421535938544f32d8b591b42 19-Jun-2014 Jeff Sharkey <jsharkey@android.com> Slow progress towards APK clusters.

Differentiate between "split APKs" and "cluster packages". A cluster
package is a directory containing zero or more APKs (base+splits),
and a monolithic package is a single APK (base).

PackageSetting will use the directory name as its codePath, so track
the baseCodePath separately. Clarify documentation in several
places.

Require that all installers provide file:// URIs through existing
hidden APIs; PackageInstaller hasn't been able to read content://
URIs for a long time.

Bug: 14975160
Change-Id: I1c6fed1b55205c2474b09871161a98a26669d22e
/frameworks/base/core/java/android/content/pm/PackageParser.java
55b1078e2a1b56daa85edfd5000a5844d3c7914b 09-Apr-2014 dcashman <dcashman@google.com> Initial work for key rotation.

Introduces the upgrade-keyset tag to AndroidManifest.xml. This specifies a
KeySet by which an apk must be signed in order to update the app. Multiple
upgrade KeySets may be specified, in which case one of them must be used to
sign the updating apk. If no upgrade-keyset is specified, the current logic
involving signatures is used.

Current Key Rotation Design Decisions:
-Apps using a shared user id may not rotate keys.
-All acceptable upgrade keysets must be specified, including the key signing
the app. This enables key rotation in one update, but also 'locks' an app if
an incorrect upgrade keyset is specified.
-Minimal changes to existing KeySet code.

Bug: 6967056
Change-Id: Ib9bb693d4e9ea1aec375291ecdc182554890d29c
/frameworks/base/core/java/android/content/pm/PackageParser.java
9d4e9bcebbd97ad51daa0ef15cfba5aabb399bbb 19-Jun-2014 Craig Mautner <cmautner@google.com> Allow a root activity to relinquish task identity

If a an acitivty with attribute android:relinquishTaskIdentity true
is the root activity of a task then the intent of that task will
be that of the first activity in the stack with
android:relinquishTaskIdentity set false.

The ability to set intent also includes the ability to set the
TaskDescription of the task.

Fixes bug 15675610.
Fixes bug 10428661.

Change-Id: Ib28a9eae3b9832eeeef9106adbebe344184ee5ae
/frameworks/base/core/java/android/content/pm/PackageParser.java
0270cfb71df55c1d213340bf9b678a48cc7b8e6e 20-Jun-2014 Jeff Sharkey <jsharkey@android.com> Merge "Explicitly collect manifest digests."
032f2b246bd01653c592f2b148d6a0debfe164b2 20-Jun-2014 Jeff Sharkey <jsharkey@android.com> Explicitly collect manifest digests.

Previously it was a side effect of collectCertificates().

Bug: 15740334
Change-Id: I2e044fdcc1c86ce730b9570bfbecf873366325e1
/frameworks/base/core/java/android/content/pm/PackageParser.java
275e085d5a42ced54bb79e40ff76c77539e7d82d 18-Jun-2014 Jeff Sharkey <jsharkey@android.com> Stronger PackageParser contract, more split work.

Require that method callers always provide relevant paths, instead of
relying on constructor. Move DisplayMetrics to be an overall parser
parameter, and move PARSE_TRUSTED_OVERLAY to flags.

Parse split APKs and apply deterministic ordering based on split
names. Assert consistent package name and version code across all
split APKs in a package, and enforce unique split names and required
base APK.

Collect certificates for split APKs, enforcing they're all signed
consistently. Better flow control and resource cleanup when
collecting certs. Refactor validation code so it's easier to reason
about. Cleaner maintenance of read buffer when draining stream
contents.

Change-Id: I8bc8c62095fbb933227b9e76ad8771f4b1246fe8
/frameworks/base/core/java/android/content/pm/PackageParser.java
9c46e06478ddd821c9172c77f48fa7f64a870ad0 19-Jun-2014 Christopher Tate <ctate@google.com> Merge "Introduce <application> attribute android:fullBackupOnly={boolean}"
d1de2567c6758e81a87c0f5eff9ff53ffebab134 18-Jun-2014 Christopher Tate <ctate@google.com> Introduce <application> attribute android:fullBackupOnly={boolean}

It is quite possible for an application to be happy with having the OS
save full-data archives of its data, but still need to selectively
filter the set of saved files or otherwise participate in full-data
backup and restore. In general we assume that any app which provides
a backup agent implementation will be directly participating via the
incremental key/value backup API; this new attribute allows an app
to tell the OS "perform full-data backup/restore for me even though
I am supplying my own agent implementation to participate."

Change-Id: I810c50d44aa683b1f23604b7d1f3e96a1722103a
/frameworks/base/core/java/android/content/pm/PackageParser.java
f62d690b00c3808496e6a5c35f3942c78fbb15d5 18-Jun-2014 Craig Mautner <cmautner@google.com> Merge "Fix persistent tasks and expand scope"
43e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4 17-Jun-2014 Craig Mautner <cmautner@google.com> Fix persistent tasks and expand scope

- Fixed missing tag closure on the xml for storing Intent categories.
- Shortened timeout for flushing tasks to persistent storage from
one minute to ten seconds.
- Made persistency the default except for those tasks on the home
stack and those tasks that exclude themselves from the recent task
list.
- Fixed deletion of tasks after restoring. Tasks now survive a second
reboot, not just the first reboot.
- Fixed sort order so most recent tasks will be restored at front.

Fixes bug 15672002.

Change-Id: I16d87d58c6fd2e879cfd0c0b18b2694432a79b71
/frameworks/base/core/java/android/content/pm/PackageParser.java
c4858a2ba972e86436d629c4d3f18eb49116de14 16-Jun-2014 Jeff Sharkey <jsharkey@android.com> Switch PackageParser to reference single path.

It previously kept mPath separate from mScanPath for some very odd
edge cases around moving apps-on-SD. This changes it to always use
a single path, refactors moving to keep separate paths.

Refactors method names in PackageParser to be clearer about their
APK-versus-package relationship.

Beginnings of a split package parser. Instead of requiring that
callers check error codes when null, switch to always throwing on
parse errors, to require that callers deal with the error. Longer
term the entire parser should switch to this style, but its too
pervasive for a simple refactoring.

Change-Id: If071d8e55e46e56cc201fadfb51cb471713ae973
/frameworks/base/core/java/android/content/pm/PackageParser.java
82b3201a95063a1fe51842417c444c0dfd8cf780 07-Jun-2014 Nick Kralevich <nnk@google.com> resolved conflicts for merge of 13ed83ee to master

Change-Id: Ia3739cfa7af60e6a47bf94d403df190f3f2cd082
ffcfcaadfefec2fb56f67a0a614a54bf4599d62b 05-Jun-2014 Craig Mautner <cmautner@google.com> Implement maxRecents and fix TaskPersister bug

Activities can now set the maximum number of times that they will
appear in the recent task lists when using DocCentric mode. The
default number is 15, the min 1, and the max 100.

Also a bug in TaskPersister that deleted files because it did not
properly parse their task ids is fixed.

Fixes bug 13736052.

Change-Id: I7ccb4e6f89d6202ff31c8577bb7b9d8d1b7e5e8d
/frameworks/base/core/java/android/content/pm/PackageParser.java
4b9d79c30eccb61645d98a4f0d49b7769e8c7ccc 22-May-2014 Amith Yamasani <yamasani@google.com> Fix singleUser attribute

Make it work correctly for singleton content providers.
Relax which apps can export singleton content providers.

Change-Id: I43d315c25ed76a876bfa6d5e0d1351bc19c9bdba
/frameworks/base/core/java/android/content/pm/PackageParser.java
3a44f3f1b446315ef894e01d2ab9b5388c2bd8c4 29-Apr-2014 Jeff Sharkey <jsharkey@android.com> Initial support for split APKs, PackageInstaller.

Defines a new PackageInstaller class that will be used for installing
and upgrading packages. An application desiring to install an
application creates a session, stages one or more package files in
that session, and then kicks off the install.

Previously, PackageManager would always make its own copy of a package
before inspecting it, to ensure the data could be trusted. This new
session concept allows the installer to write package data directly to
its final resting place on disk, reducing disk I/O and footprint
requirements. Writes are directed through an intermediate pipe
to ensure we can prevent mutations once an install has been initiated.
Also uses fallocate() internally to support optimal ext4 block
allocation using extents to reduce fragmentation.

Sessions are also the way we support installing multiple "split" APKs
in a single atomic operation. For a set of packages to form a valid
application, they must have exactly the same package name, version
code, and certificates. A session can also be used to add a small
handful of splits to an application by inheriting existing packages
when not performing a full install.

Add PackageParser support for extracting split names and certificates.

Bug: 14975160
Change-Id: I23d1bf4fbeb9f99a8c83be0c458900a0f0d1bccc
/frameworks/base/core/java/android/content/pm/PackageParser.java
6422abef786632e53337c6c298ffa64f7ddf4d90 07-May-2014 Brian Carlstrom <bdc@google.com> resolved conflicts for merge of 3bbef521 to master

Change-Id: I0bbb7c80f6c4f003779da784475d7acbfb898c94
3bbef521d4b07f86010ba0729a36ff8b73bcb0ac 07-May-2014 Brian Carlstrom <bdc@google.com> resolved conflicts for merge of f2db00fd to klp-modular-dev-plus-aosp

Change-Id: I745164033962f6222832f8f19fa316a2e2634fd0
2dac05617952e1341f9c522e4c05936d7ef07399 06-May-2014 Craig Mautner <cmautner@google.com> Add attributes and flags for DocCentric.

Add Intent flag and attribute for auto removal of task from recents
once task completes.

Add manifest attribute for auto launching into doccentric. Equivalent
to Intent.FLAG_ACTIVITY_NEW_DOCUMENT.

Fixes bug 14586473.

Change-Id: I04acc9333c3725b4db94a954358eb78df507ff53
/frameworks/base/core/java/android/content/pm/PackageParser.java
ff1ec4d9e7b7eb1b6303d147c796f8767ee6715b 17-Mar-2014 Brian Carlstrom <bdc@google.com> Use package usage information to decide what dex files to optimize in PackageManagerService

Change-Id: Iac137311e2e9d5139b5aa8651c6f3d296802612a
/frameworks/base/core/java/android/content/pm/PackageParser.java
a8e65fd82a323e6065ae9ae6cc8eaa130d3c1efd 24-Apr-2014 Kenny Root <kroot@google.com> Only remember the signer certificates for Signatures

Previously we would use the JarEntry#getCertificates API which would
return a flattened array of all the signers and their certificate chain.
Since this isn't what was intended, switch to reading the certificate
chains and only paying attention to the signer certificate.

In order to migrate during upgrades of the platform, we'll scan on boot
with a compatibility mode which will check the stores signatures in the
old format by flattening the chains of the scanned packages then
comparing the two sets.

Bug: 13678484
Change-Id: I02a5c53121d8d6f70a51d7e3b98168a41e11482e
/frameworks/base/core/java/android/content/pm/PackageParser.java
ffcda1086185f217ebfbac0735f92fcc8a9196c8 24-Apr-2014 Dianne Hackborn <hackbod@google.com> Add support for muliple active development codenames.

The resource API level is also bumped by the number of
active codenames there are.

Change-Id: Ic1bac452d5c13dc3f48040ffa47f54b28abe2ccc
/frameworks/base/core/java/android/content/pm/PackageParser.java
d2cc56ebb38b0b9e792e81ba9db8148a3a4b72f6 24-Apr-2014 Craig Mautner <cmautner@google.com> resolved conflicts for merge of f8a58208 to master

Conflicts:
core/java/android/content/pm/PackageParser.java
core/res/res/values/attrs_manifest.xml
core/res/res/values/public.xml

Change-Id: I747772e9dbc7ee1cf8993e574de4b3215f6833b2
f8a5820817eb59e0fe16e3ce0f10bb3dca090192 24-Apr-2014 Craig Mautner <cmautner@google.com> am 03981a4c: Merge "Add activity attribute allowEmbedded" into klp-modular-dev

* commit '03981a4c2e9689197e4d2c916c07ae16207b5276':
Add activity attribute allowEmbedded
ffd14a13ce7425562777152256ea7760d95f254d 24-Apr-2014 Craig Mautner <cmautner@google.com> Add activity attribute allowEmbedded

Activitys without allowEmbedded=true may not be launched in an ActivityView.

Fixes bug 13693121.

Change-Id: I431d554300fc3504ab1bc7d73a58d5dad24f8639
/frameworks/base/core/java/android/content/pm/PackageParser.java
3014733c8c10de1875de98922e03698416f94e7a 15-Apr-2014 Christopher Tate <ctate@google.com> Don't crash if a null key is passed for verification/parsing

Change-Id: I77c496d9d86d2831a4166a924afe1493aa0ac0ce
/frameworks/base/core/java/android/content/pm/PackageParser.java
4cfa8dc77ad0d74b214477ba5be28632fb3ff031 03-Apr-2014 Craig Mautner <cmautner@google.com> Add the persistable attribute for Activities

This is used for documents to allow them to be persisted across
reboots.

Fixes bug 13735406.

Change-Id: I5655ac99589d58ed5716429cf7a1ffeee677aee1
/frameworks/base/core/java/android/content/pm/PackageParser.java
7c495dcd11d64f1630bd1ebaa9259508c1175621 27-Mar-2014 Alan Viverette <alanv@google.com> Merge "Enforce restrictions on recycled TypedArrays"
fd274a0d4ab5a6777213fecb8ddf6e8099675283 27-Mar-2014 Alan Viverette <alanv@google.com> Enforce restrictions on recycled TypedArrays

No calls may be made to recycled TypedArrays, and we'll throw a
detailed exception if developers attempt to do so. Also fixes the
place where we were doin' it wrong.

BUG: 13673783
Change-Id: Ia7a382d90fce8aef7741d926028b2d01b57435ae
/frameworks/base/core/java/android/content/pm/PackageParser.java
f1977b4500e82b72ea6aa5c46d97406a20017caf 25-Mar-2014 Christopher Tate <ctate@google.com> Expand install observer semantics

...and now fail conservatively when two apps both attempt to define
the same permission. Apps signed with the same certificate are
permitted to redefine permissions.

We also finally have a (hidden) interface class for observing package
installation so that we can now rev the interface without breaking
existing callers.

Bug 13551375

Change-Id: Ifa4e59154dcccbb286ee46a35a6f25e4ad0f0f01
/frameworks/base/core/java/android/content/pm/PackageParser.java
1ee4eb074c2d85148658e93e865a18834bdced72 26-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Revert "Expand install observer semantics""
7629a18a3f190368e6268d3f2827824905683268 26-Mar-2014 Glenn Kasten <gkasten@google.com> Revert "Expand install observer semantics"

This reverts commit ab8a501f255b272af887acb0e66eb71cdf24c755.

Change-Id: I4ab4ae1a96efa2adf9d5a513793d8b84eef38b4e
/frameworks/base/core/java/android/content/pm/PackageParser.java
9067dc03ffc76c5210d26d5a53a211eff046d412 26-Mar-2014 Christopher Tate <ctate@google.com> Merge "Expand install observer semantics"
ab8a501f255b272af887acb0e66eb71cdf24c755 25-Mar-2014 Christopher Tate <ctate@google.com> Expand install observer semantics

...and now fail conservatively when two apps both attempt to define
the same permission.

We also finally have a (hidden) interface class for observing package
installation so that we can now rev the interface without breaking
existing callers.

Bug 13551375

Change-Id: I3a286d024a30e812ee4b098f345401df3c00e178
/frameworks/base/core/java/android/content/pm/PackageParser.java
e9118138402b5631e7bea74b1b8b5cbfe24ca097 24-Mar-2014 Jose Lima <joselima@google.com> resolved conflicts for merge of 6c45157c to master

Change-Id: I95d7f927f4321405318b44a21172b99f3f16e00a
d13d701681220cdcb61b5a62669e88bb77d156aa 24-Mar-2014 Jose Lima <joselima@google.com> am eb2c85df: Merge "Added isGame application tag to the manifest" into klp-modular-dev

* commit 'eb2c85df4b2d8ea5dd3cd08cb0367d5ff666afe6':
Added isGame application tag to the manifest
12d0b4cd960e18493b1dc237adbfabed432c9df5 15-Mar-2014 Jose Lima <joselima@google.com> Added isGame application tag to the manifest

Added the ability to flag applications as Games in the manifest,
so they can receive a different treatment in the UI.

Change-Id: I4c36bc1a96757030fad58ee050cd68491b31bb6c
/frameworks/base/core/java/android/content/pm/PackageParser.java
92703e62c1dc88a410a32b05c2d44f391c193140 14-Mar-2014 Jose Lima <joselima@google.com> resolved conflicts for merge of 4882ddfa to master

Change-Id: I179899697c148ac34a67b195e2dbd3df2f9138de
53ac5ef2141c7e7d99d5c00195bc65e86e7fc403 13-Mar-2014 Jose Lima <joselima@google.com> am 91726f4e: Merge "Add banner attribute to app manifest" into klp-modular-dev

* commit '91726f4ea7b60025490209ccb2637d712e8d75fd':
Add banner attribute to app manifest
f78e312db2aa7653ddc021e7dc58ce48f95ba047 06-Mar-2014 Jose Lima <joselima@google.com> Add banner attribute to app manifest

Change-Id: I28b0dc6dee9623ec7534bb0e741b88f439b48c9f
/frameworks/base/core/java/android/content/pm/PackageParser.java
531270a4a177a9f245d328d9467c6d1adbd5354a 14-Feb-2014 Nicolas Prevot <nprevot@google.com> Adding the requiredForProfile flag.

Enabling to use requiredForProfile in application manifests
It determines which applications will be installed for managed profiles
and for restricted profiles

Change-Id: I14b4de2c9f41c2bbf5cd9fd0ca6caf5ce2d04131
/frameworks/base/core/java/android/content/pm/PackageParser.java
d5c8044e7e1f1402fdd4a035690329294ab07b33 12-Feb-2014 Nick Kralevich <nnk@google.com> resolved conflicts for merge of 1cbea39f to master

Change-Id: Ib33484546c6a03cbc4cd96e97d9d785d68e10700
48d22323ce39f9aab003dce74456889b6414af55 31-Jan-2014 MÃ¥rten Kongstad <marten.kongstad@sonymobile.com> Runtime resource overlay, iteration 2

Support any number of overlay packages. Support any target package.

UPDATED PACKAGE MATCHING
------------------------
In Runtime resource overlay, iteration 1, only a single overlay package
was considered. Package matching was based on file paths:
/vendor/overlay/system/framework-res.apk corresponded to
/system/framework-res.apk. Introduce a more flexible matching scheme
where any package is an overlay package if its manifest includes

<overlay targetPackage="com.target.package"/>

For security reasons, an overlay package must fulfill certain criteria
to take effect: see below.

THE IDMAP TOOL AND IDMAP FILES
------------------------------
Idmap files are created by the 'idmap' binary; idmap files must be
present when loading packages. For the Android system, Zygote calls
'idmap' as part of the resource pre-loading. For application packages,
'idmap' is invoked via 'installd' during package installation (similar
to 'dexopt').

UPDATED FLOW
------------
The following is an outline of the start-up sequences for the Android
system and Android apps. Steps marked with '+' are introduced by this
commit.

Zygote initialization
Initial AssetManager object created
+ idmap --scan creates idmaps for overlays targeting 'android', \
stores list of overlays in /data/resource-cache/overlays.list
AssetManager caches framework-res.apk
+ AssetManager caches overlay packages listed in overlays.list

Android boot
New AssetManager's ResTable acquired
AssetManager re-uses cached framework-res.apk
+ AssetManager re-uses cached 'android' overlays (if any)

App boot
ActivityThread prepares AssetManager to load app.apk
+ ActivityThread prepares AssetManager to load app overlays (if any)
New AssetManager's ResTable acquired as per Android boot

SECURITY
--------
Overlay packages are required to be pre-loaded (in /vendor/overlay).
These packages are trusted by definition. A future iteration of runtime
resource overlay may add support for downloaded overlays, which would
likely require target and overlay signatures match for the overlay to
be trusted.

LOOKUP PRIORITY
---------------
During resource lookup, packages are sequentially queried to provide a
best match, given the constraints of the current configuration. If any
package provide a better match than what has been found so far, it
replaces the previous match. The target package is always queried last.

When loading a package with more than one overlay, the order in which
the overlays are added become significant if several packages overlay
the same resource.

Had downloaded overlays been supported, the install time could have been
used to determine the load order. Regardless, for pre-installed
overlays, the install time is randomly determined by the order in which
the Package Manager locates the packages during initial boot. To support
a well-defined order, pre-installed overlay packages are expected to
define an additional 'priority' attribute in their <overlay> tags:

<overlay targetPackage="com.target.package" priority="1234"/>

Pre-installed overlays are loaded in order of their priority attributes,
sorted in ascending order.

Assigning the same priority to several overlays targeting the same base
package leads to undefined behaviour. It is the responsibility of the
vendor to avoid this.

The following example shows the ResTable and PackageGroups after loading
an application and two overlays. The resource lookup framework will
query the packages in the order C, B, A.

+------+------+- -+------+------+
| 0x01 | | ... | | 0x7f |
+------+------+- -+------+------+
| |
"android" Target package A
|
Pre-installed overlay B (priority 1)
|
Pre-installed overlay C (priority 2)

Change-Id: If49c963149369b1957f7d2303b3dd27f669ed24e
/frameworks/base/core/java/android/content/pm/PackageParser.java
8472e6189cd4e0520c047bdb28457abc728b373f 24-Jan-2014 Dianne Hackborn <hackbod@google.com> Add app version codes to procstats.

Now the per-package proc stats data is also per-app-version-code.

In addition to changing the data structure to have one more
SparseArray and passing a version code all over, this also required
improving how we reset the stats so that we can prune a multi-package
process record back to a single package. Otherwise, as you install
updates to apps, the proc stats data would continue to explode as
the data for each of those app's processes got turned to a
multi-package due to tracking the old and new versions at the
same time.

This also bumps the checkin version code, since the package entries
also include a new field for the app version code.

Change-Id: I80de36addb0a75c7b08aef747c6f6c8012d01ee4
/frameworks/base/core/java/android/content/pm/PackageParser.java
1f0299a9cb9566fd89047569388bb2612e8bd445 12-Dec-2013 Narayan Kamath <narayan@google.com> Use StrictJarFile instead of JarFile for cert collection.

This ensures that we use the same underlying zip
processing code as the runtimes.

bug: 10193060

(cherry picked from commit eb565dc527eda8c0a43df0d1f30132638ca4ba20)

Change-Id: Iaaa26b02678278394619d0a41613d9ceeae3203c
/frameworks/base/core/java/android/content/pm/PackageParser.java
eb565dc527eda8c0a43df0d1f30132638ca4ba20 12-Dec-2013 Narayan Kamath <narayan@google.com> Use StrictJarFile instead of JarFile for cert collection.

This ensures that we use the same underlying zip
processing code as the runtimes.

bug: 10193060

Change-Id: I0f287dd6fa95207cd02f648528ef6c08dd360a72
/frameworks/base/core/java/android/content/pm/PackageParser.java
ba629da331d01d74067afdda5d4255682d4b24d7 14-Nov-2013 Christopher Tate <ctate@google.com> Ensure recipient can be launched before attempting broadcast delivery

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
/frameworks/base/core/java/android/content/pm/PackageParser.java
85f5f8132015d8a5043ea4413702420d0d157c9f 07-Oct-2013 Jeff Sharkey <jsharkey@android.com> Add <intent-filter> support to <provider>.

For the new documents work, we're only interested in the subset of
ContentProviders that actually implement DocumentsContract. Instead
of returning all providers, add <intent-filter> support to make it
easier to limit the set of returned ProviderInfo.

Define a well-known action for DocumentsProviders, and start using it
when querying for roots. Continue supporting the old <meta-data>
approach until all apps have been updated.

Bug: 8599233
Change-Id: I05f049bba21311f5421738002f99ee214447c909
/frameworks/base/core/java/android/content/pm/PackageParser.java
6d8dfbd8149942f25f2b9643a12f1fb38f3be834 24-Sep-2013 Dianne Hackborn <hackbod@google.com> Fix issue #10848916: "Always" button is not working.

The problem was that the ResolverActivity filters some activities
out of the list it shows, but it uses that display list as the
list of components the preference is set against when ultimately
setting it on the package manager... but that filtered list is *not*
the right component set, since it is not the same as the package
manager's view on it.

The fix here is to retain the original set of matching components
and use that when setting the preferred activity. Note that this
does mean that in very unusual cases where filtering is happeing
(such as one of the activities not being exported but being seen
as a possible completion from another app), then you will be setting
the preference for the complete set. Ultimately we probably need
to have the package manager apply these filtering rules up-front so
this is all consistent, but this is a very rare case so not that
important.

And then most of the change here is just improving the debug
output for intent resolution.

Change-Id: Ie35ac2c05a45946439951bbf41433c8b7de79c05
/frameworks/base/core/java/android/content/pm/PackageParser.java
fb0676a902dd1195e3e35790d137bc1b90e390ba 17-Sep-2013 Christopher Tate <ctate@google.com> Introduce maxSdkVersion for <uses-permission>

This way an application can automatically sunset its permission requests
when running on later versions of the OS where those permissions are no
longer relevant, but may be alarming to the user. A canonical example
is WRITE_EXTERNAL_STORAGE, which as of KLP becomes unnecessary for an app
to use the external storage volume solely for its own large-data needs,
without the need for actual file-system sharing among multiple apps.

Bug 9761041

Change-Id: I60130af3a108fe4a750c356038a1c8cb897e9c8b
/frameworks/base/core/java/android/content/pm/PackageParser.java
7140a25f0135f473b66d01eb042471b2f0ebc836 11-Sep-2013 Adam Skory <skory@google.com> Revert services assist context in KitKat

Reverts extension to assist context API to query
foreground services for assist context data.

Also hides Intent.ACTION_VOICE_ASSIST because
nobody's actually using it yet.

Bug: 10461702
Change-Id: Idf6836adc659b434e11ebb2b98e8b814c94a7227
/frameworks/base/core/java/android/content/pm/PackageParser.java
1d0b177754c81a20e272b91c6f703a634fe5c856 06-Sep-2013 Dianne Hackborn <hackbod@google.com> Fix issue #10560472: ApplicationInfo.manageSpaceActivity not parsed...

...correctly with overloaded resources

Change this attribute and a few other manifest attributes to allow
them to change based on platform SDK version.

Clean up a little more the whole mess with native vs. java config
bit masks.

Change-Id: Ia0baa3f7aed00bcb432701bcf99a9112124d6519
/frameworks/base/core/java/android/content/pm/PackageParser.java
eaeb19048672337714c1724de7992be8cb3f2124 06-Sep-2013 Michael Wright <michaelwr@google.com> Added support for supports-input manifest element

Change-Id: Ifa7c87908081585c1940b5a47fdf5138a287d9ea
/frameworks/base/core/java/android/content/pm/PackageParser.java
dfc7fd7818cda46b914c8a9d69d1ba00443ffe5b 06-Aug-2013 Adam Skory <skory@google.com> Extend assist context to foreground services

Add Service.onProvideAssistData(Bundle) which will be
called on foreground Services that have the new attr
in their manifest of provideAssistData = true;

Rename private reference to e.g. "getTopActivityExtras"
as "getAssistContextExtras" - do not rename the relevant
permission, since it is already public.

In ActivityManagerService, request extras both from the
top activity and from any foreground services with the
above attribute. Extend PendingActivityExtras as
PendingAssistExtras with a list of Services from which
extras are expected.

Reduce the timeout to or reporting extras from 4 sec to
just 500 ms.

Bug: 9526331
Change-Id: Ia03b96e8189033a68ae9c514c8cea0199a19bce8
/frameworks/base/core/java/android/content/pm/PackageParser.java
b09491f271c0a647632e5a99bfe280cbb7106195 23-Jul-2013 Dianne Hackborn <hackbod@google.com> 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:
/frameworks/base/core/java/android/content/pm/PackageParser.java
37dca155aaaecd79d801f53851d1d319d7ff0726 10-Jul-2013 Kenny Root <kroot@google.com> KeySets: better rejection for badly-formed manifest

During testing, I typed in a <publicKey> tag incorrectly and it
clobbered the previously defined key entry since it still parsed the
subsequent <keyset> tag defining an alias.

This gives more information in the log when running into such parsing
errors.

Change-Id: Id3c8e85530b1a5e39f4a2cb6ea8bd5521cb6918f
/frameworks/base/core/java/android/content/pm/PackageParser.java
2758e291c82901e8e22258e519dc5af228d44dcf 08-Jul-2013 Kenny Root <kroot@google.com> KeySetManager: fix indentation

Change-Id: I4fe67143bce30a7592c6a0f5a094172112bdfe43
/frameworks/base/core/java/android/content/pm/PackageParser.java
655d0e2029e6ae77a47e922dce4c4989818b8dd1 12-Jun-2013 Amith Yamasani <yamasani@google.com> 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
/frameworks/base/core/java/android/content/pm/PackageParser.java
ccbf84f44c9e6a5ed3c08673614826bb237afc54 09-May-2013 Christopher Tate <ctate@google.com> 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
/frameworks/base/core/java/android/content/pm/PackageParser.java
df1c0bf7744d4abd3e2000fcfec01c119b857c75 13-Jun-2013 Dianne Hackborn <hackbod@google.com> Add scheme specific part to IntentFilter.

Change-Id: I063d086cdc742800b8e31ddf2942f2e9230e2785
/frameworks/base/core/java/android/content/pm/PackageParser.java
821b58a93df5edcdaaad49582b4a6726770214cd 02-May-2013 Amith Yamasani <yamasani@google.com> am f5a553a4: am 55a08c5a: Merge "Allow requiredForAllUsers to work on updates to system apps" into jb-mr2-dev

* commit 'f5a553a4278a68fda9795dea759840d4f93546d7':
Allow requiredForAllUsers to work on updates to system apps
0d8750d771c8ad4db6f1f590ecda4ac23f783a84 02-May-2013 Amith Yamasani <yamasani@google.com> Allow requiredForAllUsers to work on updates to system apps

Bug: 8736380

Also set the default type as the constructor docs imply in RestrictionEntry.

Change-Id: I446504fad8822804d68f09b45ef62f6d79c4b8df
/frameworks/base/core/java/android/content/pm/PackageParser.java
18197ec438ea57b2b0bc2847e7f6d903137f9e8c 15-Apr-2013 Amith Yamasani <yamasani@google.com> am 460071f8: am 919e36d5: Merge "Allow non-system apps to use restricted accounts" into jb-mr2-dev

* commit '460071f806337f09ff789892979935916323e6a1':
Allow non-system apps to use restricted accounts
e993ae197be29e16fc54f6abf2552cf4973d64bf 15-Apr-2013 Amith Yamasani <yamasani@google.com> Allow non-system apps to use restricted accounts

Anyway they need to request account access and user will be asked to approve access to the account
at runtime.

Bug: 8617168
Change-Id: I31de852b9bb25f496becc3e6470265b5c330e6ad
/frameworks/base/core/java/android/content/pm/PackageParser.java
362c4ddff3d4278e4545e597f21477f87ebef385 14-Apr-2013 Amith Yamasani <yamasani@google.com> am 19c95bcc: am e188c984: Merge "Introducing manifest flag requiredAccountType" into jb-mr2-dev

* commit '19c95bcc76cd68e241e3d29a5e49fc892521527d':
Introducing manifest flag requiredAccountType
ccbe389b4d2cee16da77685c88fa1475bc08cdb9 13-Apr-2013 Amith Yamasani <yamasani@google.com> Introducing manifest flag requiredAccountType

This can be used by apps that won't work without an account of that
type in the limited user environment. This way we can avoid letting
users select these apps when setting up a limited user.

Bug: 8600261
Change-Id: Iaa0dd5ff88e89fa7a1d8a4e70317290268411bdb
/frameworks/base/core/java/android/content/pm/PackageParser.java
6e2157456a38c7b4db37ddba8c14caed2f0576c2 11-Apr-2013 Nick Kralevich <nnk@google.com> am c5931edb: am c65e4633: Merge "Optional <uses-permission> not yet supported." into jb-mr2-dev

* commit 'c5931edb4c8d95e90ac739ec88d8fca2610a57f1':
Optional <uses-permission> not yet supported.
32eb5b182458c05f744f9ab2963a13ef620ce069 11-Apr-2013 Nick Kralevich <nnk@google.com> Optional <uses-permission> not yet supported.

Change-Id: Ieaa97a29db75161f35905ff340b2c525bbf50612
/frameworks/base/core/java/android/content/pm/PackageParser.java
ef36045f9619a6bf735ddb4d75e6a9f3260f7ede 05-Apr-2013 Nick Kralevich <nnk@google.com> am 1fdaace1: am 80fdc962: Merge "Error on conflicting <uses-permission>" into jb-mr2-dev

* commit '1fdaace1b17ad651d1e5266bb227a26e76b91a50':
Error on conflicting <uses-permission>
73f2d3c79e57cac58fa0499accb1fb1192b7103f 04-Apr-2013 Nick Kralevich <nnk@google.com> Error on conflicting <uses-permission>

Don't install packages where we have multiple, conflicting
<uses-permission> lines for the same permission.

For example, a package which contains:

<uses-permission android:name="android.permission.INTERNET" android:required="false" />
<uses-permission android:name="android.permission.INTERNET" android:required="true" />

will now fail to install.

In addition, this change slightly refactors the code, and creates a new
parseUsesPermission() method.

Change-Id: I0f4bb8b51dc4a0c5b73458a70f706e19829275d2
/frameworks/base/core/java/android/content/pm/PackageParser.java
7b22af2c31deea3925262c842446bb821d1048d7 04-Apr-2013 Nick Kralevich <nnk@google.com> am 2c0283f5: am b2c3aa8e: Merge "PackageParser: ignore <uses-permission> android:required on older apps" into jb-mr2-dev

* commit '2c0283f5d1bc43892b2e1e6ad3b111e4933bbe34':
PackageParser: ignore <uses-permission> android:required on older apps
38f130e19ac3bb4590d400c61af8a4e5bd6c30ce 04-Apr-2013 Nick Kralevich <nnk@google.com> PackageParser: ignore <uses-permission> android:required on older apps

Don't honor <uses-permission android:required="false"> on older apps.
Lots of apps in the wild are improperly using this, and we don't
want to break them.

Bug: 8528162
Change-Id: I6e0a10bc9feac58d13ef624239c6b91e9fc34590
/frameworks/base/core/java/android/content/pm/PackageParser.java
de1175db67da94dc3bb2c1bf2cf20b961f67ccc0 03-Apr-2013 Kenny Root <kroot@google.com> resolved conflicts for merge of 0afa8b36 to master

Change-Id: I09a453ab5dbad58e3dc0858972e222a34d53b282
6c918cec31f396bb19597d107856122173c90594 02-Apr-2013 Kenny Root <kroot@google.com> Add direct API to get ManifestDigest

This makes it faster for applications that don't want to collect all the
certificates but do want the AndroidManifest.xml digest.

Bug: 8528639
Change-Id: Ide9498d0981188960af194a9568387337c075bcc
/frameworks/base/core/java/android/content/pm/PackageParser.java
b54a93adafd37b615ed0e11c5d4c2c87466a26d3 28-Mar-2013 Amith Yamasani <yamasani@google.com> am 1438d67e: am e494a81f: Merge "Restricted account visibility" into jb-mr2-dev

* commit '1438d67e7ddaba1133f181bc70cd706acf57a520':
Restricted account visibility
e494a81f9b2727edd1c537f34bf0ea83b2fb0097 28-Mar-2013 Amith Yamasani <yamasani@google.com> Merge "Restricted account visibility" into jb-mr2-dev
0ac1fc9d233b8671f371a71e2a6374b47ef069a9 28-Mar-2013 Amith Yamasani <yamasani@google.com> Restricted account visibility

When accounts are shared to a restricted/limited user, apps can
opt-in to viewing accounts of a certain type. Other shared accounts
are not visible to the app.

App would specify the account type in the manifest <application> tag
with the attribute restrictedAccountType="foo.bar", where "foo.bar"
is the account type as defined by the authenticator.

Change-Id: I7586da04d6d6d32aae15adc6b1366f325bb07384
/frameworks/base/core/java/android/content/pm/PackageParser.java
adb2578a05199730d1b48b7e092b94113122d381 28-Mar-2013 Nick Kralevich <nnk@google.com> am 96e44a2c: am 98ea19ed: Merge "Reenable optional permissions parsing and expose APIs" into jb-mr2-dev

* commit '96e44a2c2ce0579177c50a4fb710adc83530e968':
Reenable optional permissions parsing and expose APIs
828c16f140eadb9265f2bf53469902dc7cdb2284 27-Mar-2013 Nick Kralevich <nnk@google.com> Reenable optional permissions parsing and expose APIs

Modify the package parsing code to understand optional permissions
(android:required="false"). This is essentially a rollback of
e824120016248bcfe3962883fe9f3b0481dd1c3d with some minor changes.

Expose the requestPermission API to third party apps. This allows
an app to request an Intent which, when passed to
startActivityForResult, will prompt the user to approve permissions
for an app.

In the event we decide to not launch with this feature, this change
can be rolled back.

Change-Id: Ie3626deae9b16e510323f94a2c80377f7c84b26f
/frameworks/base/core/java/android/content/pm/PackageParser.java
e32011e8c06b994d840e6d568b5ffa8915320909 21-Mar-2013 Amith Yamasani <yamasani@google.com> resolved conflicts for merge of 99755cd3 to master

Change-Id: I752c387c013c3deaad836df9b0c2294e7149a32a
df2e92a535e19c00edd37318d974dab992ccc2c1 02-Mar-2013 Amith Yamasani <yamasani@google.com> Application restrictions API

Adds the ability for apps to export some restrictions. The restrictions
are presented in Settings based on the restriction type. The user's
selections are stored by UserManagerService and provided to the
target user's application as a list of RestrictionEntry objects which
contain the key, value(s).

Also introduce a manifest entry for system apps to request that the
app be automatically installed in all users, so that they cannot be
deselected by the owner user.

Shared account filtering for non-whitelisted apps.

Change-Id: I15b741e3c0f3448883cb364c130783f1f6ea7ce6
/frameworks/base/core/java/android/content/pm/PackageParser.java
dc37c5f2e32d167059382ec4bba68d4f12922516 13-Mar-2013 Dianne Hackborn <hackbod@google.com> am 0c42b580: am 53149acf: Merge "Implement limited shared libraries in apks." into jb-mr2-dev

* commit '0c42b58041dc0ede9865335fa48637fb6b677cd3':
Implement limited shared libraries in apks.
c895be7bc68b6f5b37fbb9881f464dd5ea0eb017 12-Mar-2013 Dianne Hackborn <hackbod@google.com> Implement limited shared libraries in apks.

You can now declare shared libraries in apks that are
on the system image. This is like the existing mechanism
of using raw jar files as shared libraries, but since they
are contained in an apk the library can actually be updated
from the Play Store. And this even (mostly) works.

There are some deliberate limitations on this feature. A
new shared library *must* be declared by an apk on the system
image. Installing an update to a system image apk does not
allow you to add new shared libraries; they must be defined
by everything on the base system image. This allows us to
get rid of a lot of ugly edge cases (shared libraries that were
there disappearing after an update is uninstalled for example)
and give some brakes on apps that happen to be pre-installed
on devices from being able to throw in new shared libraries
after the fact.

In working on this, I ran into a recently introduced bug where
uninstalling updated to system apps would fail. This was done
to allow for the new restricted users that don't have all
system apps, but conflicts with the existing semantics for
uninstalling system apps. To fix this I added a new uninstall
flag that lets you switch on the new mode if desired.

Also to implement the desired logic for limitations on declaring
new shared libraries in app updates, I needed to slightly tweak
the initial boot to keep the Package object for hidden system
packages associated with their PackageSetting, so we can look at
it to determine which shared libraries are allowed. I think
this is probably more right than it was before -- we already
need to parse the package anyway, so we have it, and when you
install an update to a system app we are in this same state
until you reboot anyway.

And having this fixed also allowed me to fix another bug where
we wouldn't grant a new permission to an updated app if its
system image version is updated to request the permission but
its version is still older than whatever is currently installed
as an update. So that's good.

Also add new sample code showing the implementation of an apk
shared library and a client app using it.

Change-Id: I8ccca8f3c3bffd036c5968e22bd7f8a73e69be22
/frameworks/base/core/java/android/content/pm/PackageParser.java
f1bcca82158c39da3c3696f9af954be2c0be1809 08-Jan-2013 Geremy Condra <gcondra@google.com> Added the KeySetManager.

Bug: 7554291
Change-Id: Ic693a544f1e2cab20f6540b3fc4ff673e35bd2c6
/frameworks/base/core/java/android/content/pm/PackageParser.java
fd7adedebf88427162a3ce27fcc9cfd3893c869d 23-Jan-2013 Dianne Hackborn <hackbod@google.com> Add new disabled state for "optional" built-in apps.

The disabled state allows you to make an app disabled
except for whatever parts of the system still want to
provide access to them and automatically enable them
if the user want to use it.

Currently the input method manager service is the only
part of the system that supports this, so you can put
an IME in this state and it will generally look disabled
but still be available in the IME list and once selected
switched to the enabled state.

Change-Id: I77f01c70610d82ce9070d4aabbadec8ae2cff2a3
/frameworks/base/core/java/android/content/pm/PackageParser.java
5962b12bedc4a1d0354816c1cd6b06ba04f6d807 05-Oct-2012 Craig Mautner <cmautner@google.com> Adds showWhenLocked attribute to Activities.

The new attribute allows an Activity such as the alarm to appear
on all users screens.

Bug: 7213805 fixed.
Change-Id: If7866b13d88c04af07debc69e0e875d0adc6050a
/frameworks/base/core/java/android/content/pm/PackageParser.java
d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1 28-Sep-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7211769 and #7244492, thrash around on #7226656.

Issue #7211769: Crash dialog from background user has non-working "report"

The report button now launches the issue reporter for the correct user.
Also for crashes on background users, either disable the report button,
or simply don't show the dialog depending on the build config.

Issue #7244492: Bugreport button in Quick Settings doesn't actually do anything

Now they do.

Issue #7226656: second user seeing primary user's apps

I haven't had any success at reproducing this. I have tried to tighten up
the path where we create the user to ensure nothing could cause the
user's applications to be accessed before the user it fully created and thus
make them installed... but I can't convince myself that is the actual problem.

Also tightened up the user switch code to use forground broadcasts for all
of the updates about the switch (since this is really a foreground operation),
added a facility to have BOOT_COMPELTED broadcasts not get launched for
secondary users and use that on a few key system receivers, fixed some debug
output.

Change-Id: Iadf8f8e4878a86def2e495e9d0dc40c4fb347021
/frameworks/base/core/java/android/content/pm/PackageParser.java
2ca2c8787130506d350d997c18bbc274faf88e37 17-Sep-2012 Dianne Hackborn <hackbod@google.com> More adjustments to permissions.

- New "cost money" flag can be put on a permission to
have this emphasized in the UI.
- Some further re-organization of permissions to better
match UX spec.

Change-Id: I450ac739eff6b90e7c7fc39589d68db82b61f897
/frameworks/base/core/java/android/content/pm/PackageParser.java
7454d3b73cfd0d7ad58b0285102b09aad1e0150f 13-Sep-2012 Dianne Hackborn <hackbod@google.com> New permissions UI, again.

Change-Id: I0bbecd88ff1f212b30d1ef32d5bcaa49cdf1e9ce
/frameworks/base/core/java/android/content/pm/PackageParser.java
7767eac3232ba2fb9828766813cdb481d6a97584 24-Aug-2012 Dianne Hackborn <hackbod@google.com> Keep track of whether an app is installed for each user.

This add a new per-user state for an app, indicating whether
it is installed for that user.

All system apps are always installed for all users (we still
use disable to "uninstall" them).

Now when you call into the package manager to install an app,
it will only install the app for that user unless you supply
a flag saying to install for all users. Only being installed
for the user is just the normal install state, but all other
users have marked in their state for that app that it is not
installed.

When you call the package manager APIs for information about
apps, uninstalled apps are treated as really being not visible
(somewhat more-so than disabled apps), unless you use the
GET_UNINSTALLED_PACKAGES flag.

If another user calls to install an app that is already installed,
just not for them, then the normal install process takes place
but in addition that user's installed state is toggled on.

The package manager will not send PACKAGE_ADDED, PACKAGE_REMOVED,
PACKAGE_REPLACED etc broadcasts to users who don't have a package
installed or not being involved in a change in the install state.
There are a few things that are not quite right with this -- for
example if you go through a full install (with a new apk) of an
app for one user who doesn't have it already installed, you will
still get the PACKAGED_REPLACED messages even though this is
technically the first install for your user. I'm not sure how
much of an issue this is.

When you call the existing API to uninstall an app, this toggles
the installed state of the app for that user to be off. Only if
that is the last user user that has the app uinstalled will it
actually be removed from the device. Again there is a new flag
you can pass in to force the app to be uninstalled for all users.

Also fixed issues with cleaning external storage of apps, which
was not dealing with multiple users. We now keep track of cleaning
each user for each package.

Change-Id: I00e66452b149defc08c5e0183fa673f532465ed5
/frameworks/base/core/java/android/content/pm/PackageParser.java
f02b60aa4f367516f40cf3d60fffae0c6fe3e1b8 16-Aug-2012 Dianne Hackborn <hackbod@google.com> Rename UserId to UserHandle.

This is the start of turning this into a formal public API.

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
/frameworks/base/core/java/android/content/pm/PackageParser.java
a30a4806aca7f36fb416f485b332060b03a16c0b 09-Aug-2012 Nick Kralevich <nnk@google.com> PackageParser: remove temporary code.

This code isn't needed and wasn't doing what I thought
it was doing.

Bug: 3306452
Change-Id: Ifeab672e379fd331a6f0ef1504eebb29aa6b4466
/frameworks/base/core/java/android/content/pm/PackageParser.java
9d16c219f1ca0836a832e25a61fcaf9c1d0dd67b 08-Aug-2012 Nick Kralevich <nnk@google.com> Merge "Content Providers: change default for android:exported" into jb-mr1-dev
7d19e0242faac8017033dabb872cdf1542fa184c 08-Aug-2012 Dianne Hackborn <hackbod@google.com> More mult-user API work.

- You can now use android:singleUser with receivers and providers.
- New API to send ordered broadcasts as a user.
- New Process.myUserHandle() API.

For now I am trying out "user handle" as the name for the numbers
representing users.

Change-Id: I754c713ab172494bb4251bc7a37a17324a2e235e
/frameworks/base/core/java/android/content/pm/PackageParser.java
f097b16cfddce2dbb097b929458fe9b0a402963e 28-Jul-2012 Nick Kralevich <nnk@google.com> Content Providers: change default for android:exported

Change the default value of android:exported to true
for applications which target a newer API version.
This will help stop inadvertent content provider
exposure to untrusted apps.

Bug: 3306452

Change-Id: I8cb34e823aef9551319951ce92217345c54cee63
/frameworks/base/core/java/android/content/pm/PackageParser.java
b4163a6e12ee7100c758c6d3d062ade1f2843fce 03-Aug-2012 Dianne Hackborn <hackbod@google.com> Add APIs for interacting across users.

- Expose the existing Context.sendBroadcast() as
Context.sendBroadcastAsUser().
- Add new android:singleUser attribute for services.
- Add new INTERACT_ACROSS_USERS_FULL permission for full
system-level access to cross-user interface (allows
sendBroadcastAsUser() to send to any receiver).
- Add new INTERACT_ACROSS_USERS_FULL permission for
more restricted cross-user interaction: this is required
for android:singleUser, and allows you to use
sendBroadcastAsUser() but only to send to your own
receivers.

Change-Id: I0de88f6718e9505f4de72e3f45d29c0f503b76e9
/frameworks/base/core/java/android/content/pm/PackageParser.java
2bd8d0403be62df679f0f94ab4d84c9ae9a2e918 11-Jun-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6641368: can't launch gallery

This is a revert of 1db36528b12395b9ed9bf8a1005a6d4ace737627,
but with comments added so I don't make this mistake again. :)

Change-Id: I053216279e3721f08f32f561bb989736ef619f82
/frameworks/base/core/java/android/content/pm/PackageParser.java
1db36528b12395b9ed9bf8a1005a6d4ace737627 08-Jun-2012 Dianne Hackborn <hackbod@google.com> Whoops, this version number wasn't updated when JB was introduced!

Change-Id: I9c9cd658cc1cba99b84059c8873c22b21b9f3c19
/frameworks/base/core/java/android/content/pm/PackageParser.java
4034bc431df8903072bca513a81ecdcf858c718b 01-Jun-2012 Dianne Hackborn <hackbod@google.com> Survey says: NIET!

Bug: 6593206
Change-Id: I5390609a5615d6aff1793a9bc361012a0cea330b
/frameworks/base/core/java/android/content/pm/PackageParser.java
7cb9be26c1f16de738178e89e4cf9ec8a35e7d41 31-May-2012 Kenny Root <kroot@google.com> Move package-wide flags out of parseApplication

Being on SD card and being forward-locked are package-wide flags that
shouldn't depend on an APK having an <application> stanza.

Bug: 6563724
Change-Id: If5f2159cd8e3fa136f959b656d82b05ea6bdfae5
/frameworks/base/core/java/android/content/pm/PackageParser.java
99222d212f9ff5081d4ce6eef09dbe8eff85b83a 07-May-2012 Dianne Hackborn <hackbod@google.com> Finish up issue #6249094: Display permissions based on relevance to private data

Added bitmaps for permission group icons. We had to pick either
icons for a dark or light background, and it had to be light for
settings, so the installer theme has gone back to dark.

Tweaked the permission groups to match the icons.

Redid the group priorities to make them correct (they were written
with higher priorities being less important).

Fixed bug where priority was not being used for system apps.

Change-Id: Ia3d3f0c1614a11b4cfd11682ce9e6c9f87d75c06
/frameworks/base/core/java/android/content/pm/PackageParser.java
fd5015be41080970c9a992a8ef17a1deefb57478 01-May-2012 Dianne Hackborn <hackbod@google.com> Add new APIs for permission group flags and priorities.

Change-Id: I2d476c6aa9dbd05407ec49be45986f42d2acf9e7
/frameworks/base/core/java/android/content/pm/PackageParser.java
a4a54e2a5f383e766bfecaec776e0b00002badd1 17-Apr-2012 Amith Yamasani <yamasani@google.com> Make sure persistent processes are not replicated for secondary users.

An intent is launched in a singleton process if the process is persistent
and the resolved activity/service/etc is not requested to run in a different
process.

Change-Id: I1463e73a76bc8bde4185f9cf4395edb47515841d
/frameworks/base/core/java/android/content/pm/PackageParser.java
79af6063d536eb7edbc73be0fa2b8eb734758db7 10-Apr-2012 Dianne Hackborn <hackbod@google.com> Merge "Hide the optional permission stuff, not making it in to JB."
e824120016248bcfe3962883fe9f3b0481dd1c3d 06-Apr-2012 Dianne Hackborn <hackbod@google.com> Hide the optional permission stuff, not making it in to JB.

Also lock down the rest of the development tools permissions to
be development permissions that must be granted through an
explicit shell command.

Change-Id: I1ba216fffe1aab4bb9f83fcef108efc504f892f4
/frameworks/base/core/java/android/content/pm/PackageParser.java
5e4705a82786103982b2c9980b0dcd0bb54208d3 06-Apr-2012 Dianne Hackborn <hackbod@google.com> Fix dumb bug.

Change-Id: I5e0dfc0f03677888c22d938013299a8ec4597c69
/frameworks/base/core/java/android/content/pm/PackageParser.java
31b0e0e86ad061cd8005e80817bcad017e2d56dd 06-Apr-2012 Dianne Hackborn <hackbod@google.com> Implement call log permission compatibility.

If a pre-JellyBean application requests read/write contacts, it
will implicitly be given read/write call log.

Change-Id: I029db4b09fda737bb8fba4e1611355ebdbbfd34f
/frameworks/base/core/java/android/content/pm/PackageParser.java
dd8fab2629131b09367df747afd9a61e42dd1992 23-Mar-2012 Adam Powell <adamp@google.com> TaskStackBuilder and Activity navigation features for framework

Promote navigation helpers from the support library to the core
platform.

The support library's meta-data element has been replaced with a
first-class parentActivityName attribute. This attribute is valid
on both activity and activity-alias elements. An activity-alias
will inherit the target activity's parentActivityName if one is
not explicitly specified.

Automatic Up navigation for Activities

Add the public method onNavigateUp() to Activity. The default
implementation will use the metadata supplied in the manifest about an
activity's hierarchical parent (parentActivityName) to do the right
thing.

If any activities in the parent chain require special Intent
arguments, the Activity subclass should override onNavigateUp() to
properly implement Up navigation for the app, supplying such arguments
as needed.

If automatic Up navigation within the same task can't find an activity
matching the supplied intent in the current task stack, it will act as
an in-app "home" and return to the root activity (presumably the app's
front page) in that task. (From this state, pressing "back" with
default behavior will return to the launcher.)

Change-Id: If163e27e59587f7af36975a09c986cb117ec3bc6
/frameworks/base/core/java/android/content/pm/PackageParser.java
59dfce8bdaf011337530a0dbec7f7280871f9bc9 03-Apr-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #6140391 Make RTL awareness as an opt-in into the AndroidManifest

- introduce "supportsRtl" as a new application attribute in the AndroidManifest
- "supportsRtl" default value is FALSE (no RTL support)
- adapt the View layoutDirection and textDirection logic to take care of "supportsRtl" value

Change-Id: I5e4f9f576e14f35dedc6b0c29a7142c397f598e0
/frameworks/base/core/java/android/content/pm/PackageParser.java
135936072b24b090fb63940aea41b408d855a4f3 23-Mar-2012 Amith Yamasani <yamasani@google.com> User management and switching

Broadcast intents that get sent out when users are added/removed/switched.

More work on generating user-specific information in package manager queries.
APIs to update user name and query a user by id.
Removed Package.mSetStopped and mSetEnabled, since they're not user specific.

User removal:
- Cleanup ActivityManager, PackageManager, WallpaperManager, AppWidgetService
and AccountManager.
- Shutdown processes belonging to the user.

Don't show vibrate option in long-press power if there's no vibrator.

Lock the screen when switching users, to force unlocking.

Change-Id: Ib23a721cb75285eef5fd6ba8c7272462764038fa
/frameworks/base/core/java/android/content/pm/PackageParser.java
483f3b06ea84440a082e21b68ec2c2e54046f5a6 14-Mar-2012 Amith Yamasani <yamasani@google.com> Package restrictions per user

Packages can be enabled/disabled per user.
This requires maintaining stopped/launched states and
enabled / disabled components and packages per user.

Refactored pm.Settings and PackageSettingsBase to keep
track of states per user.

Migrated the stopped-packages.xml to users/<u>/package-restrictions.xml

Changed intent resolution to handle individual user restrictions.
Bunch of IPackageManager calls now have a userId argument.
Make AppWidgetService handle removals of packages.

Added some tests for pm.Settings and PackageManager.

Change-Id: Ia83b529e1df88dbcb3bd55ebfc952a6e9b20e861
/frameworks/base/core/java/android/content/pm/PackageParser.java
7924512aa12c6af37d90e8ccfcdf04eb78a294a3 12-Mar-2012 Dianne Hackborn <hackbod@google.com> Add new READ_EXTERNAL_STORAGE permission.

Also adds some initial compatibility code for dealing with it.

Change-Id: I104bff11798349e4aaa6da9b7be787b257daa1bb
/frameworks/base/core/java/android/content/pm/PackageParser.java
6569625beef705ec489662b80d372c4423f9c7f7 06-Mar-2012 Dianne Hackborn <hackbod@google.com> Fix issues #6103378 and #5959515.

Change-Id: I762d86dd7119c9ac02f4b8803c4a250c6b7637c7
6103378: APR: IOOBE at android.content.pm.PackageParser.generatePackageInfo(
PackageParser.java:355)
5959515: PackageManager doesn't validate className in setComponentEnabledSetting
/frameworks/base/core/java/android/content/pm/PackageParser.java
e639da7baa23121e35aa06d6e182558e0e755696 22-Feb-2012 Dianne Hackborn <hackbod@google.com> New development permissions.

These are permissions that an application can request, but won't
normally be granted. To have the permission granted, the user
must explicitly do so through a new "adb shell pm grant" command.

I put these permissions in the "development tools" permission
group. Looking at the stuff there, I think all of the permissions
we already had in that group should be turned to development
permissions; I don't think any of them are protecting public APIs,
and they are really not things normal applications should use.

The support this, the protectionLevel of a permission has been
modified to consist of a base protection type with additional
flags. The signatureOrSystem permission has thus been converted
to a signature base type with a new "system" flag; you can use
"system" and/or "dangerous" flags with signature permissions as
desired.

The permissions UI has been updated to understand these new types
of permissions and know when to display them. Along with doing
that, it also now shows you which permissions are new when updating
an existing application.

This also starts laying the ground-work for "optional" permissions
(which development permissions are a certain specialized form of).
Completing that work requires some more features in the package
manager to understand generic optional permissions (having a
facility to not apply them when installing), along with the
appropriate UI for the app and user to manage those permissions.

Change-Id: I6571785c6bb5f6b291862b7a9be584885f88f3a5
/frameworks/base/core/java/android/content/pm/PackageParser.java
37ce3a8af6faab675319d0803b288ab1dddc76be 06-Feb-2012 Amith Yamasani <yamasani@google.com> Multi-user - wallpaper service

- Allow each user to have their own wallpaper (live or static).
- Migrate old wallpaper on upgrade.
- Update SystemBackupAgent to backup/restore from primary user's
new wallpaper directory.

Reduce dependency on Binder.getOrigCallingUser() by passing the
userId for bindService.

Change-Id: I19c8c3296d3d2efa7f28f951d4b84407489e2166
/frameworks/base/core/java/android/content/pm/PackageParser.java
a0c283eac33dd2da72235751bbfa4f2d9898d5ea 09-Feb-2012 Dianne Hackborn <hackbod@google.com> Add new feature for running services in "isolated" sandbox processes.

This reserves a range of uids (for each user) in which these processes
run. These uids are not associated with an application, so they
effectively run with no permissions. When a Service requests to
run in such a process through android:isolatedProcess="true", each
time it is brought up a new isolated process is started with its
own unique uid.

What we have so far gives us the basic infrastructure; more work
remains to further lock down what these uids have access to.

Change-Id: Ibfd27c75619cba61f528f46ede9113f98dc5f45b
/frameworks/base/core/java/android/content/pm/PackageParser.java
742a67127366c376fdf188ff99ba30b27d3bf90c 04-May-2011 Amith Yamasani <yamasani@google.com> Multi-user - 1st major checkin

Switching activity stacks
Cache ContentProvider per user
Long-press power to switch users (on phone)

Added ServiceMap for separating services by user
Launch PendingIntents on the correct user's uid
Fix task switching from Recents list
AppWidgetService is mostly working.

Commands added to pm and am to allow creating and switching profiles.

Change-Id: I15810e8cfbe50a04bd3323a7ef5a8ff4230870ed
/frameworks/base/core/java/android/content/pm/PackageParser.java
0836c7cb98dd3ff1ef0379dcb97be8b315fed7eb 21-Oct-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5228934: IME shows up on boot, or when digits screen is tapped

Activity aliases weren't propagating the softInputMode from the original
activity.

Change-Id: I47534e6c9a0f94bb6eb3fd2186ba9ffc8d583d08
/frameworks/base/core/java/android/content/pm/PackageParser.java
05ca4c90644921df9193d92b2abdc81ef77e4a62 15-Sep-2011 Kenny Root <kroot@google.com> Allow non-required package verifiers

* Verifiers can be specified in the AndroidManifest.xml

* Those verifiers can respond to the new Intent action

* PackageManager API for those verifiers: verifyPendingInstall

Change-Id: I4892bce2e6984871e6e93c60a1ca0dae145f5df5
/frameworks/base/core/java/android/content/pm/PackageParser.java
d2509fd83597595914ef0627685e917380863eb6 12-Sep-2011 Dianne Hackborn <hackbod@google.com> Add boot mode where only "core apps" are started.

A core app is one that has coreApp="true" in its manifest tag.

The system can successfully boot (though a little painfully) with
only framework-res.apk, SettingsProvider.apk, SystemUI.apk,
DefaultContainerService.apk, and Launcher2.apk set as core apps.

Currently this boot mode is always turned off.

Change-Id: Ieaa4a8031c2c391a12996aa8d8b1d65fc2b09d6b
/frameworks/base/core/java/android/content/pm/PackageParser.java
bcc954d772e8cd5ef640060cbc0be50e7e4778f2 09-Aug-2011 Kenny Root <kroot@google.com> Manifest digest stored during package scanning

This allows things that scanned an APK to pass a hash of the manifest to
others that would then be able to compare it.

Change-Id: I465f5edf3acab2a952c3d321c8df2247ffe012ea
/frameworks/base/core/java/android/content/pm/PackageParser.java
d2d2925ff7ae9456c1c6c9147b1b9fd9a99ea607 08-Aug-2011 Kenny Root <kroot@google.com> Eliminate warnings from PackageParser

Change-Id: I1e07029261df59907115fd1f54da3e9b3fbfa240
/frameworks/base/core/java/android/content/pm/PackageParser.java
1ebd74acf9977daa42133507e970dab88e08f0ef 04-Aug-2011 Kenny Root <kroot@google.com> Better error codes for missing files

Make sure that files that don't exist aren't returning bogus 'out of
space' error codes.

Add some Javadoc so I can remember what each thing does in an IDE.

Add copyright header to NativeLibraryHelper

Bug: 3375299
Change-Id: Iac46019160921daca65b21d38897e5165063316e
/frameworks/base/core/java/android/content/pm/PackageParser.java
269248d112e35fe8e9f0d5d11c96dcb2ac1118b0 02-Aug-2011 Adam Powell <adamp@google.com> Fix bug 5098288 - Rethink the suite of new themes

Cut down the list of new themes for ICS. Holo apps now have
Theme.Holo, Theme.Holo.Light, and Theme.Holo.Light.DarkActionBar to
choose from.

Add manifest attribute android:uiOptions to express
splitActionBarWhenNarrow. Other options may move into this later as
well. (DialogWhenLarge?) This attribute is valid on both activity and
application tags; application settings will serve as the default for
activities that do not explicitly set uiOptions.

uiOptions are not currently reflected in the startup window for new
activities.

Change-Id: Iffdc2ce4cc69f79c9bd4e541b7923286e6936c1e
/frameworks/base/core/java/android/content/pm/PackageParser.java
79ec80db70d788f35aa13346e4684ecbd401bd84 24-Jun-2011 Christopher Tate <ctate@google.com> Make full backup API available to apps

New methods for full backup/restore have been added to BackupAgent
(still hidden): onFullBackup() and onRestoreFile(). The former is the
entry point for a full app backup to adb/socket/etc: the app then writes
all of its files, entire, to the output. During restore, the latter
new callback is invoked, once for each file being restored.

The full backup/restore interface does not use the previously-defined
BackupDataInput / BackupDataOutput classes, because those classes
provide an API designed for incremental key/value data structuring.
Instead, a new FullBackupDataOutput class has been introduced, through
which we restrict apps' abilities to write data during a full backup
operation to *only* writing entire on-disk files via a new BackupAgent
method called fullBackupFile().

"FullBackupAgent" exists now solely as a concrete shell class that
can be instantiated in the case of apps that do not have their own
BackupAgent implementations.

Along with the API change, responsibility for backing up the .apk
file and OBB container has been moved into the framework rather than
have the application side of the transaction do it.

Change-Id: I12849b06b1a6e4c44d080587c1e9828a52b70dae
/frameworks/base/core/java/android/content/pm/PackageParser.java
2d6833bab353e31ceb4230f3f3563fca2e0d9f6f 25-Jun-2011 Dianne Hackborn <hackbod@google.com> Turn on HW accel by default for apps that target ICS.

Change-Id: I010e11e03b2dfd0d1db8c47f74c25a28586fd79c
/frameworks/base/core/java/android/content/pm/PackageParser.java
0ac3031c159a0904e73eb4439cdc724d8df4a6e6 17-Jun-2011 Dianne Hackborn <hackbod@google.com> Implement remaining infrastructure for user disabling apps.

Change-Id: If8135eb0e27ec36f8f159eb7b6397add7acd0299
/frameworks/base/core/java/android/content/pm/PackageParser.java
b0628bfd5aac480a0d412ac96b8af1d97ac01c30 03-Jun-2011 Christopher Tate <ctate@google.com> Implement shared-storage full backup/restore

Every available shared-storage volume is backed up, tagged with its
ordinal in the set of mounted shared volumes. This is an approximation
of "internal + the external card". This lets us restore things to the
same volume [or "equivalent" volume, in the case of a cross-model
restore] as they originated on.

Also fixed a bug in the handling of files/dirs with spaces in
their names.

Change-Id: I380019da8d0bb5b3699bd7c11eeff621a88e78c3
/frameworks/base/core/java/android/content/pm/PackageParser.java
ead40eaedb7993ca8c5153c349dd65f276d6862e 04-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of cc20b4e3 to master

Change-Id: I990368443a16a0577f7a1f5623b348cca3f81ac4
2515db74fe2e75018f618591fabe23fda8362bf3 03-Jun-2011 Dianne Hackborn <hackbod@google.com> am 3a80c504: am 8b9a2b6c: am e6676351: Work around OpenFeint bug.

* commit '3a80c50485809fe72d6de83dacad494c5e84ed24':
Work around OpenFeint bug.
546d64f56d0f930070289e26021f97638601e388 02-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 5c2e4d20 to master

Change-Id: Iadbee872468ceafb54c5877046c91f6052f3c953
2762ff3dc864018352362f6d103de471f9529ba6 02-Jun-2011 Dianne Hackborn <hackbod@google.com> Add new supports-screen API to set maximum allowed size.

Change-Id: I0a7cd4ba73a4c18558e6daee28963d5fd12c7978
/frameworks/base/core/java/android/content/pm/PackageParser.java
e66763516a9c27c192adaba417616371a1c3c9bf 02-Jun-2011 Dianne Hackborn <hackbod@google.com> Work around OpenFeint bug.

Change-Id: Ib8320e50bb63fc56dc0118d5c8e9e328dbd3fcb1
/frameworks/base/core/java/android/content/pm/PackageParser.java
df6e980e3f63eb0f6f9eb437fa925d5009cd9c44 26-May-2011 Dianne Hackborn <hackbod@google.com> Add new supports-screens attributes for declaring the compatible screens.

Change-Id: I40d57e4354e48accc1027c9f90916ea73eb5190d
android:requiresSmallestWidthDp provides the smallest supported width.
android:compatibleWidthLimitDp provides the largest compatible width.
/frameworks/base/core/java/android/content/pm/PackageParser.java
161e67ff3ba26408eea09221734ad2e29a1eed11 20-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 06a8ceac to master

Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
69cb87576ba163b61bb0e6477a3b7c57a9b11d40 20-May-2011 Dianne Hackborn <hackbod@google.com> Add new "-swNNNdp" resource qualifier.

Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
/frameworks/base/core/java/android/content/pm/PackageParser.java
0305e354e12c9ff25bfd252cb282346632171b73 13-May-2011 Dianne Hackborn <hackbod@google.com> This API change is now part of MR2.

Change-Id: I242e66fb9c46d48244942298361f408062fb05c4
/frameworks/base/core/java/android/content/pm/PackageParser.java
ebff8f92f13513ce37bd74759eb1db63f2220590 13-May-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE. Integrate add new screen width/height in "dp" configs.

You can now specify resource configuration variants "wNNNdp"
and "hNNNdp". These are the minimum screen width/height in "dp"
units. This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes. Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted. To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I4acb73d82677b74092c1da9e4046a4951921f9f4
/frameworks/base/core/java/android/content/pm/PackageParser.java
4a627c71ff53a4fca1f961f4b1dcc0461df18a06 01-Apr-2011 Christopher Tate <ctate@google.com> Full local backup infrastructure

This is the basic infrastructure for pulling a full(*) backup of the
device's data over an adb(**) connection to the local device. The
basic process consists of these interacting pieces:

1. The framework's BackupManagerService, which coordinates the
collection of app data and routing to the destination.

2. A new framework-provided BackupAgent implementation called
FullBackupAgent, which is instantiated in the target applications'
processes in turn, and knows how to emit a datastream that contains
all of the app's saved data files.

3. A new shell-level program called "bu" that is used to bridge from
adb to the framework's Backup Manager.

4. adb itself, which now knows how to use 'bu' to kick off a backup
operation and pull the resulting data stream to the desktop host.

5. A system-provided application that verifies with the user that
an attempted backup/restore operation is in fact expected and to
be allowed.

The full agent implementation is not used during normal operation of
the delta-based app-customized remote backup process. Instead it's
used during user-confirmed *full* backup of applications and all their
data to a local destination, e.g. via the adb connection.

The output format is 'tar'. This makes it very easy for the end
user to examine the resulting dataset, e.g. for purpose of extracting
files for debug purposes; as well as making it easy to contemplate
adding things like a direct gzip stage to the data pipeline during
backup/restore. It also makes it convenient to construct and maintain
synthetic backup datasets for testing purposes.

Within the tar format, certain artificial conventions are used.
All files are stored within top-level directories according to
their semantic origin:

apps/pkgname/a/ : Application .apk file itself
apps/pkgname/obb/: The application's associated .obb containers
apps/pkgname/f/ : The subtree rooted at the getFilesDir() location
apps/pkgname/db/ : The subtree rooted at the getDatabasePath() parent
apps/pkgname/sp/ : The subtree rooted at the getSharedPrefsFile() parent
apps/pkgname/r/ : Files stored relative to the root of the app's file tree
apps/pkgname/c/ : Reserved for the app's getCacheDir() tree; not stored.

For each package, the first entry in the tar stream is a file called
"_manifest", nominally rooted at apps/pkgname. This file contains some
metadata about the package whose data is stored in the archive.

The contents of shared storage can optionally be included in the tar
stream. It is placed in the synthetic location:

shared/...

uid/gid are ignored; app uids are assigned at install time, and the
app's data is handled from within its own execution environment, so
will automatically have the app's correct uid.

Forward-locked .apk files are never backed up. System-partition
.apk files are not backed up unless they have been overridden by a
post-factory upgrade, in which case the current .apk *is* backed up --
i.e. the .apk that matches the on-disk data. The manifest preceding
each application's portion of the tar stream provides version numbers
and signature blocks for version checking, as well as an indication
of whether the restore logic should expect to install the .apk before
extracting the data.

System packages can designate their own full backup agents. This is
to manage things like the settings provider which (a) cannot be shut
down on the fly in order to do a clean snapshot of their file trees,
and (b) manage data that is not only irrelevant but actively hostile
to non-identical devices -- CDMA telephony settings would seriously
mess up a GSM device if emplaced there blind, for example.

When a full backup or restore is initiated from adb, the system will
present a confirmation UI that the user must explicitly respond to
within a short [~ 30 seconds] timeout. This is to avoid the
possibility of malicious desktop-side software secretly grabbing a copy
of all the user's data for nefarious purposes.

(*) The backup is not strictly a full mirror. In particular, the
settings database is not cloned; it is handled the same way that
it is in cloud backup/restore. This is because some settings
are actively destructive if cloned onto a different (or
especially a different-model) device: telephony settings and
AndroidID are good examples of this.

(**) On the framework side it doesn't care that it's adb; it just
sends the tar stream to a file descriptor. This can easily be
retargeted around whatever transport we might decide to use
in the future.

KNOWN ISSUES:

* the security UI is desperately ugly; no proper designs have yet
been done for it
* restore is not yet implemented
* shared storage backup is not yet implemented
* symlinks aren't yet handled, though some infrastructure for
dealing with them has been put in place.

Change-Id: Ia8347611e23b398af36ea22c36dff0a276b1ce91
/frameworks/base/core/java/android/content/pm/PackageParser.java
25641ca1ac5b09727f86fe01389877332a00455d 19-Apr-2011 Amith Yamasani <yamasani@google.com> Merge "Plumbing in PackageManager and installd for multi-user support."
0b285499db739ba50f2f839d633e763c70e67f96 15-Apr-2011 Amith Yamasani <yamasani@google.com> Plumbing in PackageManager and installd for multi-user support.

- Create /data/user directory and symlink /data/user/0 -> /data/data for
backward compatibility
- Create data directories for all packages for new user

- Remove data directories when removing a user

- Create data directories for all users when a package is created

- Clear / Remove data for multiple users

- Fixed a bug in verifying the location of a system app

- pm commands for createUser and removeUser (will be disabled later)

- symlink duplicate lib directories to the original lib directory

Change-Id: Id9fdfcf0e62406a8896aa811314dfc08d5f6ed95
/frameworks/base/core/java/android/content/pm/PackageParser.java
0c5001d776d56bae02a5cc2663286a125d99bc5e 13-Apr-2011 Dianne Hackborn <hackbod@google.com> Add APIs to remove tasks.

You can remove sub-tasks inside of a task, or an entire task.

When removing an entire task, you can have its process killed
as well.

When the process is killed, any running services will get an
onTaskRemoved() callback for them to do cleanup before their
process is killed (and the service possibly restarted).

Or they can set a new android:stopWithTask attribute to just
have the service automatically (cleanly) stopped at this point.

Change-Id: I1891bc2da006fa53b99c52f9040f1145650e6808
/frameworks/base/core/java/android/content/pm/PackageParser.java
43a17654cf4bfe7f1ec22bd8b7b32daccdf27c09 07-Apr-2011 Joe Onorato <joeo@google.com> Remove the deprecated things from Config.java. These haven't been working since before 1.0.

Change-Id: Ic2e8fa68797ea9d486f4117f3d82c98233cdab1e
/frameworks/base/core/java/android/content/pm/PackageParser.java
3fc982f41fda1f254bfbc35490d81cd82a0ed90a 31-Mar-2011 Dianne Hackborn <hackbod@google.com> Add new resource configurations for screen width/height in "dp".

You can now specify resource configuration variants "wNNNdp"
and "hNNNdp". These are the minimum screen width/height in "dp"
units. This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes. Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted. To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I22f8afa136b4f274423978c570fa7c9855040496
/frameworks/base/core/java/android/content/pm/PackageParser.java
e7f972122db87dc54e41ed1a6e417534d43bca3a 24-Feb-2011 Dianne Hackborn <hackbod@google.com> Implement issue #3426299: Introduce application "stopped" state

The package manager now keeps track of whether an application is
stopped. There are new intent flags to control whether intent
filters in a stopped application will match the intent. This is
currently used in one place, sending broadcasts, so that stopped
apps can not be launched due to background processes.

The package manager during first init makes sure no applications
are in the stopped state. When new applications are installed,
that begin in the stopped state. When the activity manager is
launching a component of an application, it ensures the application
is taken out of the stopped state.

The "force stop" button in manage applications will now put an
application back in to the stopped state; it can't go back out
of the stopped state until one of its components is launched by
the activity manager.

There will probably be a few more places where we need to filter
stopped applications out of intent matches, but doing this for
broadcast is a very big first step.

This also introduces a new broadcast that is sent to an application
after it is replaced with a new .apk. But only if the app is not
in the stopped state. This makes it a lot easier for developers to
implement code to get their application back in proper running shape
after an upgrade.

Finally another new broadcast is added that is sent to a package's
installer at the first time it is launched. This allows the installer
to tell the package about it being installed only when it is first
actually used.

Change-Id: I589c53ff0e0ece868fe734ace4439c0d202dca2d
/frameworks/base/core/java/android/content/pm/PackageParser.java
4b7b7ccd6651f54239c8849d4d85a633c2bbdf6a 02-Feb-2011 John Reck <jreck@google.com> Fix COMPONENT_ENABLED_STATE check (copy from HC)

This fixes a problem where ai.enabled would be set to false incorrectly,
causing widgets to not show up in launcher.

Change-Id: I25e11ab9033e1d8d3dcc581edcbe40acdddd1f85
/frameworks/base/core/java/android/content/pm/PackageParser.java
3b403694be42836b50adb061448d6a27697b12ac 17-Jan-2011 Dianne Hackborn <hackbod@google.com> am 64e30643: am c237bb27: Merge "Add manifest API to request a large heap." into honeycomb

* commit '64e306430570fcfb35a1b14e1b333ad114b23829':
Add manifest API to request a large heap.
3b81bc18bb661c02ad8074c39dab16644c1e65d0 15-Jan-2011 Dianne Hackborn <hackbod@google.com> Add manifest API to request a large heap.

You can now do android:largeHeap="true" on an application.

Doesn't yet do anything, waiting for Dalvik API.

Also tweak package parsing so that the SDK API level is set in the
configuration, allowing manifest resource value selection based on
that.

Change-Id: I6e035f9702a97b055416743b88f83a22ba4a9584
/frameworks/base/core/java/android/content/pm/PackageParser.java
8c3dc00a7d34776f1abff6dabd4a3d9f377952a0 13-Jan-2011 Jason parks <jparks@google.com> am 4a534fa8: am a3cdaa53: Revert "Remove the APIs for the old encryption scheme."

* commit '4a534fa899e0101e26e5b670383aa357c10483b8':
Revert "Remove the APIs for the old encryption scheme."
a3cdaa5337fa573c4c61770195d6232c2e587090 13-Jan-2011 Jason parks <jparks@google.com> Revert "Remove the APIs for the old encryption scheme."

This reverts commit 1125d780a8b61703b8eb28c5c77dac5f3f0022dd.
/frameworks/base/core/java/android/content/pm/PackageParser.java
02f9acbdb4df8758d0474a1a968f12bd18ed6f92 13-Jan-2011 Jason parks <jparks@google.com> am da6f7dbf: am ca6777b2: Merge "Remove the APIs for the old encryption scheme." into honeycomb

* commit 'da6f7dbf9f8bf90c84147dbc57b885b3ece03e81':
Remove the APIs for the old encryption scheme.
ca6777b23bbe9283380efb2ba7e6d0a79d8669db 13-Jan-2011 Jason parks <jparks@google.com> Merge "Remove the APIs for the old encryption scheme." into honeycomb
1125d780a8b61703b8eb28c5c77dac5f3f0022dd 12-Jan-2011 Jason parks <jparks@google.com> Remove the APIs for the old encryption scheme.

Change-Id: I55116a5b29b10dfd50015805ec019b485257f68b
/frameworks/base/core/java/android/content/pm/PackageParser.java
090093592e24a067c08c4049344fcf37601960c0 12-Jan-2011 Kenny Root <kroot@google.com> am c669559d: am b5a4b5d3: Merge "Allow updated system apps to retain priority" into honeycomb

* commit 'c669559dc3c1d348145d902c623166a9d874b5a8':
Allow updated system apps to retain priority
502e9a47c64d819a7aa45251bcf7cb5dd77a310b 10-Jan-2011 Kenny Root <kroot@google.com> Allow updated system apps to retain priority

Previously any updated system apps would not be able to have a greater
than 0 priority on an activity intent filter. Moving the priority check
later in the package scanning allows it to apply to updated system
packages as well.

Cherry-pick from gingerbread branch

Bug: 2572398
Change-Id: I95d8b6360bf7a3f39cd7a1ff09e1ee57e11583d8
/frameworks/base/core/java/android/content/pm/PackageParser.java
1f22d2a31abc5fa8a2d97f1f506bb2c25c87a96b 08-Jan-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE Fix issue #3333958: Package Manager can sometimes mistakenly think...

...an app is disabled!

Ouch.

Change-Id: I45dc2beef4e413fd447d905632901fadd924cb6e
/frameworks/base/core/java/android/content/pm/PackageParser.java
b35cd54b88292bd6cf0387406ad9071f5475c6a7 05-Jan-2011 Dianne Hackborn <hackbod@google.com> No longer needed.

Change-Id: Ia2e8264147bb02e29599227d0588e40b1e626358
/frameworks/base/core/java/android/content/pm/PackageParser.java
ccc714131359eb1022d8c6702b7d82ab9e93f27c 13-Dec-2010 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 78e9f4cb to master

Change-Id: I1135361e6d66f524c3f349e2bf1f31bd4191c634
e4a5951925f16f18dae91ed65567e96528f17fee 07-Dec-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3154576: battery stats checkin should include UID -> packages+ map

Includes some other small fixes to battery collection and a few
other things.

Output of package info looks like this:

5,0,i,uid,1000,com.android.settings
5,0,i,uid,1000,com.android.providers.subscribedfeeds
5,0,i,uid,1000,com.android.providers.settings
5,0,i,uid,1000,com.android.server.vpn
5,0,i,uid,1000,android
5,0,i,uid,1000,com.android.systemui
5,0,i,uid,1000,com.google.android.backup
5,0,i,uid,1001,com.android.phone
5,0,i,uid,1001,com.android.providers.telephony
5,0,i,uid,1022,com.android.nfc
5,0,i,uid,10021,com.google.android.location
5,0,i,uid,10021,com.google.android.syncadapters.calendar
5,0,i,uid,10021,com.google.android.gsf
5,0,i,uid,10021,com.google.android.syncadapters.contacts
5,0,i,uid,10026,com.android.providers.downloads.ui
5,0,i,uid,10026,com.android.providers.media
5,0,i,uid,10026,com.android.providers.drm
5,0,i,uid,10026,com.android.providers.downloads
5,0,i,uid,10032,com.android.launcher
5,0,i,uid,10039,com.google.android.gm
5,0,i,uid,10041,com.google.android.gallery3d
5,0,i,uid,10049,com.android.providers.calendar

Change-Id: I9e38f254eef146339113ad270f5c6e8b60fb7a1d
/frameworks/base/core/java/android/content/pm/PackageParser.java
a0b46c9c441f017a2008ca8ee2c864987465996b 22-Oct-2010 Dianne Hackborn <hackbod@google.com> Implement issue #3116702: New manifest tags for supported screen sizes

Merged from GB.

Change-Id: I94730b54bcacd083f77708e84c35f4932a7b9d2e
/frameworks/base/core/java/android/content/pm/PackageParser.java
a6d9c7c04c4b17d85ac70f4494777555655f3be1 22-Oct-2010 Dianne Hackborn <hackbod@google.com> Implement issue #3116702: New manifest tags for supported screen sizes DO NOT MERGE

Change-Id: Iabf64d86c89d387ffbfbc39f950d308a73fe17eb
/frameworks/base/core/java/android/content/pm/PackageParser.java
615e2fa1755ea3b6b8196f783842cd394ad3beb2 10-Oct-2010 Dianne Hackborn <hackbod@google.com> am b77455ee: am 78d68836: Implement tracking of package install times.

Merge commit 'b77455ee290691b036ac79236a93e57ff294ef0c'

* commit 'b77455ee290691b036ac79236a93e57ff294ef0c':
Implement tracking of package install times.
78d688369a2240009d3bbe4126996a973b2e2fe2 07-Oct-2010 Dianne Hackborn <hackbod@google.com> Implement tracking of package install times.

Provides information about the time at which the package was
first installed and the time it was last updated.

Change-Id: Icb43f77b5b669a1ce685e8913046b8be386b6175
/frameworks/base/core/java/android/content/pm/PackageParser.java
72b526a13c9b548a1e1a0239f670e36744cb0fdc 07-Oct-2010 Dianne Hackborn <hackbod@google.com> am cb9f1e4d: am 6f7e10ca: Merge "Make it easier to figure out whether an app can go on sd card." into gingerbread

Merge commit 'cb9f1e4d30ab4f9203e30abe807cbe33d07db4a0'

* commit 'cb9f1e4d30ab4f9203e30abe807cbe33d07db4a0':
Make it easier to figure out whether an app can go on sd card.
54e570f78b45d6c47578a4a2513097b590b6d43f 05-Oct-2010 Dianne Hackborn <hackbod@google.com> Make it easier to figure out whether an app can go on sd card.

Change-Id: I9195a0881b2c435b138f39c2ab1505dc820caf10
/frameworks/base/core/java/android/content/pm/PackageParser.java
dc71b9e4d67327065a992924a021cad4bc100fa2 01-Oct-2010 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 6a3eddb4 to master

Change-Id: I1ca1d100274d4a733ef2bf58b0d5d7217b4f858e
cef65eeb0315c3118bf8860d6f723cb49ff6bc52 01-Oct-2010 Dianne Hackborn <hackbod@google.com> Rub in a little 'ol log-b-gone.

Mmmmmm... great fresh scent!

Change-Id: I050e70b31b5d4a9c6731f15a4b51a3620a33a78d
/frameworks/base/core/java/android/content/pm/PackageParser.java
cc8f44bc819a76ac8d0127c57a303bd839240a62 28-Sep-2010 Kenny Root <kroot@google.com> am e7dd4e38: am 04a426f5: Merge "Use buffered I/O during certificate parsing" into gingerbread

Merge commit 'e7dd4e38c47f2f7760d1ce4f86d6321e17f98d1d'

* commit 'e7dd4e38c47f2f7760d1ce4f86d6321e17f98d1d':
Use buffered I/O during certificate parsing
d63f7dbf5d30320e8fd4dd8056d245f7b1e818ba 27-Sep-2010 Kenny Root <kroot@google.com> Use buffered I/O during certificate parsing

The PackageParser was using a raw InputStream instead of wrapping it in
a BufferedInputStream which could degrade performance.

Change-Id: I15c86c3ead363ddbadf4ae27e011feda90fcc579
/frameworks/base/core/java/android/content/pm/PackageParser.java
234e42df5fac958ed9f15aae6005dd72e4bdf08a 25-Sep-2010 Dianne Hackborn <hackbod@google.com> DO NOT MERGE. Fix issue #3000764: API REVIEW: android.R.*

Not going out in GB.

Change-Id: I9d4f5938ec7d2a54c0f72b8eb5a177ee66f12146
/frameworks/base/core/java/android/content/pm/PackageParser.java
d02bdaab495641ab50e2123fdfd99a819cc40540 26-Aug-2010 Daniel Sandler <dsandler@android.com> Remove experimental immersive mode support. DO NOT MERGE

Bug: 2949215

Change-Id: I7d998ef571ef7e149bb96261430e92150b80b77d
/frameworks/base/core/java/android/content/pm/PackageParser.java
41bfa37cb2ca244432061bddb1c8bf802545ae6e 27-Aug-2010 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 409b7120 to master

Change-Id: I1741e205b5ff5ae62a38ab3b096bcc3d96883538
02486b1327e3007c62d253dd89ba9db1852b87f8 26-Aug-2010 Dianne Hackborn <hackbod@google.com> Hide heavy-weight API.

And give it a better name, for when it is later un-hidden.

Change-Id: Iae0d3054d44f873b9f953bc41d175a47802a185e
/frameworks/base/core/java/android/content/pm/PackageParser.java
3e6d50cc484f2eee0cff63789cc7796718eb6b68 24-Aug-2010 Dianne Hackborn <hackbod@google.com> Make Theme.Holo the default theme for new apps.

Also change Holo to have an action bar, instead of a title bar.

Change-Id: I45c2f06938509ae02cde99d1c06c228f86e8e3e8
/frameworks/base/core/java/android/content/pm/PackageParser.java
ce845d73015acea0a337dd06721f5c649f565242 05-Aug-2010 Kenny Root <kroot@google.com> am c5183aca: am c68bcc32: Merge "Only allow one movePackage operation in-flight" into gingerbread

Merge commit 'c5183acae55e08f4bfcb58aa122a200863748a63'

* commit 'c5183acae55e08f4bfcb58aa122a200863748a63':
Only allow one movePackage operation in-flight
529b60a3b16ac3dff24f2403d760ab8ebc9670ff 04-Aug-2010 Romain Guy <romainguy@google.com> Add android:hardwareAccelerated to Activity.

Hardware acceleration can now be enabled/disabled locally on each activity
declared in the manifest. It can also be enabled/disabled directly on a
window through the WindowManager.LayoutParams.

Change-Id: I91dd0b26c4e7eb8cd7288e523ed6b7bda6d0990b
/frameworks/base/core/java/android/content/pm/PackageParser.java
deb112674e9940a46c87fa4e3bae5d8d1ee84ef3 02-Aug-2010 Kenny Root <kroot@google.com> Only allow one movePackage operation in-flight

When a movePackage operation is requested, don't allow multiple requests
to pile up for one package. Once a move is completed, an observer will
receive the message and be allowed to call movePackage again.

Change-Id: Ie3842b6d96446febc0037bf9b8f1ca250735edc2
/frameworks/base/core/java/android/content/pm/PackageParser.java
b0289f62af77a2811b4528fe284aad871e3c6b31 02-Aug-2010 Kenny Root <kroot@google.com> am 59d4a536: am 739cdab7: Merge "Do not deference before null check" into gingerbread

Merge commit '59d4a5369cd68d4b65809ded407611b62b013f9a'

* commit '59d4a5369cd68d4b65809ded407611b62b013f9a':
Do not deference before null check
930d3af75f9e9663222f4c4a1d75b326cf811e35 31-Jul-2010 Kenny Root <kroot@google.com> Do not deference before null check

The return of parsePackageLite wasn't checked until after it was
deferenced. Move the deference below the null check and remove redundant
set.

Bug: 2852726
Change-Id: I3eaaea5050948145eed44b64507dc846993d98eb
/frameworks/base/core/java/android/content/pm/PackageParser.java
4cca89c0425a93dd842d85a56205c017a418e1c1 26-Jul-2010 Dianne Hackborn <hackbod@google.com> am 3a2ff74f: am 46730fc7: Fix handling of application disabled state.

Merge commit '3a2ff74fa4c3f014555ec64fccc16e1b9f6d0111'

* commit '3a2ff74fa4c3f014555ec64fccc16e1b9f6d0111':
Fix handling of application disabled state.
46730fc78388607fd562044cbaaa26ffc9f65337 25-Jul-2010 Dianne Hackborn <hackbod@google.com> Fix handling of application disabled state.

Change-Id: I617b76e89eeb75437b384b92f1205bb00b15bb70
/frameworks/base/core/java/android/content/pm/PackageParser.java
6c55b8b143b4cc8335789bff58a2ac545bd58806 23-Jun-2010 Daniel Sandler <dsandler@android.com> am 71764c4c: am 613dde4a: Revised "immersive mode" API.

Merge commit '71764c4ce5b248a79542238b171a783e82e0fe37'

* commit '71764c4ce5b248a79542238b171a783e82e0fe37':
Revised "immersive mode" API.
613dde4aa651e11dac3db859723cc6faf8fc0a82 21-Jun-2010 Daniel Sandler <dsandler@android.com> Revised "immersive mode" API.

No longer a window bit, FLAG_IMMERSIVE is now set on
ActivityInfo.flags and in the Activity's manifest as
android:immersive="true" (ActivityInfo).

[An "immersive" activity is one that wishes to avoid being
paused by full-screen notifications (like an incoming call).
An activity that sets FLAG_IMMERSIVE/android:immersive is
sending a signal to the notification manager, status bar,
etc. that they should try to find some other way to get the
user's attention in high-priority situations.]

[Originally: change Ie290c2e.]

Change-Id: I967bb10b930b8f0772b10f81f2957a03fa3f1736
/frameworks/base/core/java/android/content/pm/PackageParser.java
d0b15cecc63b03ca4e42549ed3a54ae2c7e31866 04-Jun-2010 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of f3307ae8 to master

Change-Id: Ic59db363391f73343eba32894113914ceea5a963
860755faa6bdd3c2aeae49c05b87b5bc080ae60c 04-Jun-2010 Dianne Hackborn <hackbod@google.com> Add support for heavy-weight applications.

Only one can be running at a time, their process can not be killed,
and a notification is posted while it is running.

Change-Id: I843015723947e0c934ae63a1aeee139327c0bc01
/frameworks/base/core/java/android/content/pm/PackageParser.java
812ccbeb3ce55c50463fda1d161b2eeed8b19cd2 01-Jun-2010 Romain Guy <romainguy@google.com> Add new hardwareAccelerated manifest attribute to enable HW drawing.

Change-Id: I2bb0252f3699cb720e7f5b6868419c9904e4fb35
/frameworks/base/core/java/android/content/pm/PackageParser.java
14cee9f688c32d63d8521188e7422811629bb7c2 24-Apr-2010 Dianne Hackborn <hackbod@google.com> New xlarge screen size.

Not complete, only for experimentation at this point.

This includes a reworking of how screen size configurations are matched,
so that if you are on a larger screen we can select configurations for
smaller screens if there aren't any exactly matching the current screen.

The screen size at which we switch to xlarge has been arbitrarily
chosen; the compatibility behavior has not yet been defined.

Change-Id: I1a33b3818eeb51a68fb72397568c39ab040a07f5
/frameworks/base/core/java/android/content/pm/PackageParser.java
81cd2e90ccdda498234384c8207afe2213714e60 22-Apr-2010 Adam Powell <adamp@google.com> Logo attribute for manifest and PackageManager methods to fetch it

Change-Id: I2c5ac44a4e2af982a616b2012901d7395013b19f
/frameworks/base/core/java/android/content/pm/PackageParser.java
5a0797a91016e85bb50a7d5c0d7e031166429ddd 06-Apr-2010 Dianne Hackborn <hackbod@google.com> am c94dad83: am 6e52b5d7: 2568467 System crash when installing corrupt APK

Merge commit 'c94dad83be792928206363cb43524a68b6a62ffe' into kraken

* commit 'c94dad83be792928206363cb43524a68b6a62ffe':
2568467 System crash when installing corrupt APK
f0adaa1bd579a0749406f6f5c72d00a0a62eb0e6 06-Apr-2010 Dianne Hackborn <hackbod@google.com> am eab92d7b: am 01f6b75b: Merge "Fix issue #2564479: Favorite Recipes App Installation Fail" into froyo

Merge commit 'eab92d7bec5ff0d12ee68047bba4ade3afb718a7' into kraken

* commit 'eab92d7bec5ff0d12ee68047bba4ade3afb718a7':
Fix issue #2564479: Favorite Recipes App Installation Fail
6e52b5d76850ee60bbef2f3d8a2e47bd589e28e8 05-Apr-2010 Dianne Hackborn <hackbod@google.com> 2568467 System crash when installing corrupt APK

Also fix another crash I just saw in the package manager, when a
permission got left around from a previous install but as no
longer defined.

Change-Id: I33b87420f0c59e24b8b77fab8b0316461d99e048
/frameworks/base/core/java/android/content/pm/PackageParser.java
d1cff1b4a477bad7f6c968572ecdff26ca6e8cda 03-Apr-2010 Dianne Hackborn <hackbod@google.com> Fix issue #2564479: Favorite Recipes App Installation Fail

Change-Id: Ide1045e3f6bef9ed2a2fee08bfeda8c58feb685f
/frameworks/base/core/java/android/content/pm/PackageParser.java
1f4df90bfab8ca42eabe95f19eadff3432eee7fd 27-Mar-2010 Oscar Montemayor <oam@google.com> DO NOT MERGE
Removing unused features from source tree.
Please refer to Bug#2502219.

Change-Id: I879c29bfd5ffe933f64bb1082aaae7c956450a5a
/frameworks/base/core/java/android/content/pm/PackageParser.java
ef3f5ddc2137ed99e41f00441b688fb56b855179 30-Mar-2010 Ben Cheng <bccheng@android.com> Replace "safeMode" with a more specific name "vmSafeMode" in the public API.

Bug: 2553512
Change-Id: Id0dad80ecdcb8c7430dcf1ac26132ccd9c0770f5
/frameworks/base/core/java/android/content/pm/PackageParser.java
806da1d46c94c71728b94dec75dec6519c962b5c 19-Mar-2010 Dianne Hackborn <hackbod@google.com> Fix issue #2512507: Shortcuts and Widgets lost on upgrading from Eclair to FRE70D

Apps on the system partition are now allowed to change their certs, as
long as they are not using a shared user id.

Change-Id: I02ff7ac874dc649b7f8cbb705ae8d7ed31e1d125
/frameworks/base/core/java/android/content/pm/PackageParser.java
90d8ee650be988d8479f4f14ae8e541bb4cb034b 18-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> Switch default install location to unspecified.
Add a new install location unspecified for backward compatibility.
There is not much difference between policies auto and unspecified.
But we dont have to make any code changes in PackageParser based
on our preference for install location.
Add tests

Change-Id: I563238133261d911d08fbc66344687b7dfc870b1
/frameworks/base/core/java/android/content/pm/PackageParser.java
3de55bcd34afd5871816526294f9514d1adf3fe5 13-Mar-2010 Christopher Tate <ctate@google.com> API CHANGE: expose the backup-related ApplicationInfo flag masks

Fixes bug #2507582 by doing the following:

- Un-@hide the FLAG_ALLOW_BACKUP, FLAG_KILL_AFTER_RESTORE, and
FLAG_RESTORE_ANY_VERSION mask constants in ApplicationInfo. These
correspond, respectively, to the <application> manifest tag's
android:allowBackup, android:killAfterRestore, and
android:restoreAnyVersion attributes.

- Remove the android:restoreNeedsApplication attribute and the
corresponding FLAG_RESTORE_NEEDS_APPLICATION constant [which was still
marked @hide]. We now always use the application's own Application
class when performing a normal restore. In the future when we support
an externalized full-filesystem backup/restore operation, we will use
an OS-defined agent class with a base-class Application instance, but
this will not happen until a future release.

Also expands real documentation on the above ApplicationInfo constants;
that work is part of bug #2465360

Change-Id: I735d07a963ae80a01343637d83bef84e4c23fdcc
/frameworks/base/core/java/android/content/pm/PackageParser.java
6069beb2dfed6da837bf7faa3db3f6119edc017a 10-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> Rename ApplicationInfo.FLAG_ON_SDCARD to ApplicationInfo.FLAG_EXTERNAL_STORAGE

Change-Id: Iadef9f9bb2851c38b6d79be1bafbf932abce4210

Change-Id: I2e412bace3d8005db5057a3497bd836d0038b90c
/frameworks/base/core/java/android/content/pm/PackageParser.java
cf244ada58539ce857ec041d7288d0271204fbb6 10-Mar-2010 Dianne Hackborn <hackbod@google.com> Add ability for some manifest attributes to reference resources.

This loosens our restriction on many manifest attributes requiring
literal string values, to allow various ones to use values from
resources. This is only allowed if the resource value does not change
from configuration changes, and the restriction is still in place
for attributes that are core to security (requesting permissions) or
market operation (used libraries and features etc).

Change-Id: I4da02f6a5196cb6a7dbcff9ac25403904c42c2c8
/frameworks/base/core/java/android/content/pm/PackageParser.java
a2b6c3775ed6b8924232d6a01bae4a19740a15f8 06-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> Add conditions to check for updated system applications. Restrict them
to internal flash only even before we copy.

Return error codes when install flag options mismatch.
Some conditions for existings apps
- install flags override existing location
- explicity manifest option install location overrides previous location
- if upgraded package's install location is unspecified or auto, fall
back to recommended install policy which considers user setting as well.

Check for sdcard status before finding available size on sdcard
Add light weight parsing for manifest attributes including package name and
install location only

Change-Id: I5143dda87c88c595f564b317326c926d0ec3ceb8
/frameworks/base/core/java/android/content/pm/PackageParser.java
c1552397be706c243338389c628a44eee6011eae 04-Mar-2010 Dianne Hackborn <hackbod@google.com> Allow multiple original-package tags.

Also fix some issues with moving files from update commands.
/frameworks/base/core/java/android/content/pm/PackageParser.java
aaec779513737a70007dea955f60e1b8bcbc2f1a 25-Feb-2010 Suchi Amalapurapu <asuchitra@google.com> Pick up default install location
/frameworks/base/core/java/android/content/pm/PackageParser.java
2269d1572e5fcfb725ea55f5764d8c3280d69f6d 25-Feb-2010 Dianne Hackborn <hackbod@google.com> Re-arrange android-common so framework no longer links with it.

This is the framework part, moving classes around so the framework
no longer needs to link to android-common. Makes some APIs public,
others that didn't need to be public are private in the framework,
some small things are copied.
/frameworks/base/core/java/android/content/pm/PackageParser.java
3dda518a4fd57cdded3afa50d8aa206501de7fc6 25-Feb-2010 Christopher Tate <ctate@google.com> Add 'restoreAnyVersion' attr for apps that want to restore "future" data

If a backup-participating app sets android:restoreAnyVersion="true" in its
manifest <application> tag, then its agent will be invoked for restore
even if the available dataset was created by a later version of the app
than is currently installed on the device. This will not typically be
a problem for third party applications, since for them the installation
and initial data restore are tightly coupled, but it can cause serious
problems for applications which are both preinstalled on the system
partition and overridden by later updates. The primary difficulty
that this new attribute addresses is this:

1. User buys a Nexus One, Market self-updates, and the user installs some apps.
At this point the backup data on the server may indicate that the version of
Market which originated its bookkeeping is newer than the stock N1 Market app.
2. User loses their phone, and buys a replacement N1. At setup time, Market
has not yet had a chance to self-update, so when the restore comes in, it's
tagged as being from "the future" and so the restore is refused. No apps get
reinstalled.

Bug: 2442127
Change-Id: I076a9553dc613e5c3189350e778315718ed1ed2b
/frameworks/base/core/java/android/content/pm/PackageParser.java
6dee18c5cfdd5d63f3a9c299d2b61f819c07e920 10-Feb-2010 Dianne Hackborn <hackbod@google.com> New implementation of <original-package> tag.

We now have the new package retain the name of the old package. This makes
sure that all existing references to it (shortcuts, widgets, etc) will still
work.

This does mean that your package can run under either the old or new name,
depending on whether the user got it with an update. Buyer beware!

I have tried testing all of the paths of updating, installing another
update in /data, uninstalling the update, updating system with an even
newer update, etc. I think they all work. No promises though.
/frameworks/base/core/java/android/content/pm/PackageParser.java
23085b781e145ed684e7270af1d5ced6800b8eff 09-Feb-2010 Ben Cheng <bccheng@android.com> Support per-application switch to execute the VM in safe mode.

The new attribute can be set by adding android:safeMode="true"
in AndroidManifest.xml with the SDK.

Tested with pairing locally compiled SDK with Eclipse and verified that the JIT
(the only component currently included in the safe mode) is indeed disabled
with the new attribute.

Bug: 2267583
/frameworks/base/core/java/android/content/pm/PackageParser.java
117818e4f171b1fd9daa05349c48f61388f04567 09-Feb-2010 Suchi Amalapurapu <asuchitra@google.com> Add new manifest option for install location
Change recommendAppInstallLocation api
add code to parse new attribute.
Define flags in PackageInfo
Add new settings attributes for enabling setting and value for install location
Some tests
The policy for install location: if explicitly set in manifest as internal only we try to install the app only on internal storage. if set to preferExternal, we try to install it on sdcard if possible. If not we fall back to internal.
If the user enables setting SET_INSTALL_LOCATION(which will always
be set to false in final release builds) and sets a prefered location, we try
to honour it.
/frameworks/base/core/java/android/content/pm/PackageParser.java
e04b1ad9cd3d9a159d4c7721a374f987be1062cd 09-Feb-2010 Bjorn Bringert <bringert@android.com> Fix NPE in PackageParser

Before, PackageParser threw NPE when reading <path-permission>
android:writePermission set.

Fixes http://b/issue?id=2430967

Change-Id: I4c69f0210ab362a649ff239c5f9e927d93c2f241
/frameworks/base/core/java/android/content/pm/PackageParser.java
b858dfda5012a1040927ed62c3bb856c3294d882 02-Feb-2010 Dianne Hackborn <hackbod@google.com> Implement system data migration support.

This adds three new features:

- <original-package android:name="com.foo" /> manifest tag.
This allows an .apk to specify another package it originally came from,
propagating all state and data from the old to new package.

- <adopt-permissions android:name="com.foo" /> manifest tag.
In some more complicated cases, a new .apk may be a combination
of multiple older .apks that each declared their own permissions.
This allows you to propagate the permissions from these other
.apks into the new one.

- A new system/etc/updatecmds directory.
You can place files here which describe data files to move from
one package to another. (See below for details.)

Also in this change: we now clean up the data directories of
.apks that disappear from the system image, and some improvements
to logging and reporting error messages.

A typical file in the updatecmds directory looks like this:

-------
com.google.android.gsf:com.google.android.providers.talk
databases/talk.db
com.google.android.gsf:com.google.android.googleapps
databases/gls.db
-------

This says that for com.google.android.sfs, there are two packages to
move files from:

From com.google.android.providers.talk, the file databases/talk.db.
From com.google.android.googleapps, the file databases/gls.db

As part of moving the file, its owner will be changed from the old
package to whoever is the owner of the new package's data directory.

If those two files had existed, after booting you would now have the
files:

/data/data/com.google.android.gsf/databases/talk.db
/data/data/com.google.android.gsf/databases/gls.db

Note that all three of these facilities assume that the older .apk
is completely removed from the newer system. The WILL NOT work
correctly if the older .apk still remains.
/frameworks/base/core/java/android/content/pm/PackageParser.java
8aa2e8939c61d788cbc192098465e79f584e173a 22-Jan-2010 Dianne Hackborn <hackbod@google.com> More device admin work: description, policy control.

There is now a description attribute associated with all components,
that can supply user-visible information about what the component does.
We use this to show such information about device admins, and wallpapers
are also updated to be able to show this in addition to the existing
description in their meta-data.

This also defines security control for admins, requiring that they
declare the policies they will touch, and enforcing that they do
so to be able to use various APIs.
/frameworks/base/core/java/android/content/pm/PackageParser.java
af8e9f4805643f90a9dc0ecfa119e0a860c12f8a 12-Jan-2010 Suchi Amalapurapu <asuchitra@google.com> app install on sdcard. provide skeleton implementation
to install an app on sdcard, just resources.
Add new install path for /asec in installd.
ignore . when checking for apk path since the sdcard packages id'ed
by package name.
Add new -s option to adb shell pm
Refactor fwd locked from scanMode to ApplicationInfo.
Add new flag for sd install
Add new parse flags for fwd locking and installing on sdcard
New mock api's in PackageManagerService to invoke MountService api's. These
will be refactored again and so have been wrapped internally.
Some error codes in PackageManager
Changes in PackageManagerService to use mPath and mScanPath during installation
and switch to using PackageParser.Package.applicationInfo attributes for
source and public resource directories.
Some known issues that will be addressed later
using system_uid for now. needs some tinkering with uid and packagesetting creation to use the actual app uid
error handling from vold not very robust. ignoring lot of things for now
sending a delayed destroy to delete packages. will revisit later
revisit temp file creation later. just copy for now
/frameworks/base/core/java/android/content/pm/PackageParser.java
f0108cda21bec61418b24aa6217406072780b5d5 22-Dec-2009 Tom Taylor <tomtaylor@google.com> resolved conflicts for merge of ad2fa35d to master

Change-Id: Ia4362cd48ac0689b91003943a4cd9660da72ff90
d4a4729c0cac582a2dcec7c8cfb316b81885a0f0 21-Dec-2009 Tom Taylor <tomtaylor@google.com> Update imports to android-common

Several files were moved to android-common. Update all the references
to import those files from the new location.
/frameworks/base/core/java/android/content/pm/PackageParser.java
506de3b57667e76cf92086b30d007c21c2cebbfd 25-Nov-2009 Dianne Hackborn <hackbod@google.com> am 5417933a: am d1689ea8: am 8e1985d4: Merge change Ie552036f into eclair

Merge commit '5417933a456f23a0ca30bb73632feee5dd5f8e46'

* commit '5417933a456f23a0ca30bb73632feee5dd5f8e46':
Fix issue #2286419: maxSdkVersion causes existing apps to disappear.
935ef2c4f43eaa849f62055c383d8fd7dcf3eead 25-Nov-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2286419: maxSdkVersion causes existing apps to disappear.

Change-Id: Ie552036f4ea673e0ce9981ff1cbd1fbe08678510
/frameworks/base/core/java/android/content/pm/PackageParser.java
1874aa487cf5da31f5770d21f0973a417f99247c 11-Nov-2009 Oscar Montemayor <oam@google.com> Encrypted File Systems project. Implementation of opt-out flag in AndroidManifest XML file.
This flag is necessary for applications to specifythat their daa is never to be encrypted when the encrypted file system feature is
commplete and enabled.
Encrypted File Systems project.
Adding android:neverEncrypt flag to AndroidManifest.XML to allow packages to opt-out from EFS features.

Encrypted File Systems Project.
Fixing white spaces and end-line issues.

Encrypted File SYstems Project: opt-out flag.
Removed AndroidManifest.xml changes, as will make that change in a separate integration.
/frameworks/base/core/java/android/content/pm/PackageParser.java
d83006cbe86545a1e8882b1a4ed90005ebf3423e 29-Oct-2009 Suchi Amalapurapu <asuchitra@google.com> When upgrading packages with shared user ids make sure we are eliminating
the package about to be deleted or upgraded when updating permissions associated
with the shared user. Include a simple null check when retrieving the permission.

Fix PackageParser to avoid ArrayIndexOutOfBounds exceptions in several places
/frameworks/base/core/java/android/content/pm/PackageParser.java
8d5ae98549f68a1214a72e6d79456503eb7d96f5 06-Oct-2009 Suchi Amalapurapu <asuchitra@google.com> Make sdk version and code names static finals in PackageParser.
Remove api to set these values.
Remove an unused method in AppSecurityPermissions
/frameworks/base/core/java/android/content/pm/PackageParser.java
bd0a81ff1c0e92e80e05e2f12bb1805c7d081e94 04-Oct-2009 Dianne Hackborn <hackbod@google.com> Work on issue #2163789: Way too much logging

Dr.No from mcleron.

Change-Id: Iaca2268684f83fe8757e64db0b0e047a19755311
/frameworks/base/core/java/android/content/pm/PackageParser.java
a33e3f79259b56b03c7912af35944f34ad190e3c 30-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2154794: Force close when start facebook application.

I think when we were scanning the updated app in the system image,
from an older version on the data partition, we were not setting
the existing package to have the system flag, so not auto-granting
any new permissions.

This also includes some other cleanup in the package manager to
remove old files in various places, and tighten up logging.

Also similar logging cleanup elsewhere.

Change-Id: I6d113c7cf7e736ab9be512d6d7c94c806a24199a
/frameworks/base/core/java/android/content/pm/PackageParser.java
7eca687c2ee8f633678a1cd3ebf0886c0e6bbcf9 29-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix bug where we would return null with disabled components.

Change-Id: I1624a42803f1c4b02736f558a8eeeeba2890667e
/frameworks/base/core/java/android/content/pm/PackageParser.java
ffa424800d0338b8b894aef2ea1e3e3344cbda7a 24-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2133206: dialogs/menus should auto-dismiss when screen turns off

Lot of infrastructure for more things to go away when "clear system dialogs"
happens, and now do this when we turn on the lock screen.

Change-Id: I567130296fe47ce82df065ed58ef21b37416ceaf
/frameworks/base/core/java/android/content/pm/PackageParser.java
5e1ab335e6e8fbfa19c64d53880a22f472010953 02-Sep-2009 Christopher Tate <ctate@android.com> Expand apps' control over the settings restore process

Applications can now specify two more aspects of the restore process: whether
they need to run with their own custom Application subclass rather than being
launched in the usual restricted mode during restore, and whether it's okay for
the backup manager to kill the app process once restore has completed. The new
manifest attributes for these are, respectively, android:restoreNeedsApplication
and android:killAfterRestore.

If unspecified in the manifest, restoreNeedsApplication is false, and
killAfterRestore is true.

In order to support kill-after-restore cleanly, this change also adds a new
system-process-only interface to the Activity Manager, which will schedule a
"commit suicide" event on the target app's main thread looper.

The framework backup agents have been given the appropriate new backup
attributes as well.
/frameworks/base/core/java/android/content/pm/PackageParser.java
49237345d83e62fdb9eb8d50b13ad086636a04fa 28-Aug-2009 Dianne Hackborn <hackbod@google.com> Add platform infrastructure for features.

This introduces a new mechanism to define features associated with
a platform, query the current device for the available features,
and enforce that apps requiring features that aren't available can't
be installed.

Also now allows uses-library to specify that a library is optional,
so the lack of such a library will not prevent the app from being
installed (but if it does exist it will be correctly linked into
the app).

Change-Id: I5b369b46cfa0b3d37c9e08fd14ef1098a978e67b
/frameworks/base/core/java/android/content/pm/PackageParser.java
c748541ca0caffbe33c1d4690773d89c06bb3253 27-Aug-2009 Suchi Amalapurapu <asuchitra@google.com> Add a null check in PackageParser
/frameworks/base/core/java/android/content/pm/PackageParser.java
11b822d2a91ea17c34c0cb1c11e80a9a30d72864 22-Jul-2009 Dianne Hackborn <hackbod@google.com> Simplify density compatibility to a boolean.

Instead of a list, we now just have a single boolean indicating whether an
application is density aware, and this set set to true by default as of
Donut.
/frameworks/base/core/java/android/content/pm/PackageParser.java
c4db95c077f826585d20be2f3db4043c53d30cf5 22-Jul-2009 Dianne Hackborn <hackbod@google.com> First pass at reworking screen density/size APIs.

This changes the names of the directories in aapt, to what you see
in the list of DpiTest resources. Also adds a new "long" configuration
for wide screens, which the platform sets appropriate, and introduces
a new kind of resizeability for not large but significantly larger
than normal screens which may have compatibility issues.
/frameworks/base/core/java/android/content/pm/PackageParser.java
69fff4a72d4dfc9208db79d773ef3ca23350287e 21-Jul-2009 Mitsuru Oshima <oshima@google.com> * Disable compatibility mode for all cases.
/frameworks/base/core/java/android/content/pm/PackageParser.java
841f13c8e9ff3f7695b6c18a8abcec3c947983ff 18-Jul-2009 Mitsuru Oshima <oshima@google.com> * Reverted the change in PackageParser that I checked by accident
* More surface view fix.
- correct event translation on surface view.
- use compatible window
* removed FLAG_NO_COMPATIBILITY_SCALE. It was my misunderstanding of how SurfaceView works, and this was not necessary.
* Added compatibility related info to package dumpsys
/frameworks/base/core/java/android/content/pm/PackageParser.java
ba3ba57921dedaaef669719c0359c0caf60e008b 09-Jul-2009 Mitsuru Oshima <oshima@google.com> * Use cached resources for widgets
/frameworks/base/core/java/android/content/pm/PackageParser.java
854060af30f928c0a65591e9c8314ae17056e6b8 10-Jul-2009 Dianne Hackborn <hackbod@google.com> Fix bug #1873249i: Apps can DoS/brick device

This is the problem where various things are listening for broadcasts
(such as battery status, PIN/PUK/Network) that an application can send
to cause harm to the system.

Solving this is tricky because many of these broadcasts are sticky,
and I have never figured out how to do permissions with sticky
broadcasts in a sane way. So instead, I am going to punt on the
general problem and just brute force it:

There is new a way for system components to declare specific
broadcast actions to be protected, which means that only the system
and the phone can send them. This is good enough for now. None
of it is exposed in the public API so we can make something a little
less stupid in the future if we ever need to.
/frameworks/base/core/java/android/content/pm/PackageParser.java
2af632f87d487deaa5b2eb71341cfc4f0c0d1173 08-Jul-2009 Dianne Hackborn <hackbod@google.com> Add new <path-permission tag for use by global search.

This adds a new <path-permission> tag you can use inside of a <provide>
to define additional path-based permissions that broaden the global
read and write permissions. The initial use for this will be global
search, so that a content provider that is protected by permissions
can make a part of itself available to global search under another
permission. This addresses the issue with global search not being able
to request permissions it would need of providers it doesn't know
about at build time.
/frameworks/base/core/java/android/content/pm/PackageParser.java
1ecf5d28817f0a051e77488380dcd5bc622ea169 07-Jul-2009 Mitsuru Oshima <oshima@google.com> Re-implementation of large screen support using window manager.
* added background filler surface to fill the outer rim. Using the same layer as dim surface because
they never co-exists (in the same window)
* clean up the obsolete code in CompatibiltyMode/ViewRoot for support large screen support.
/frameworks/base/core/java/android/content/pm/PackageParser.java
723738cfaec3dd7b0fe152c872c41bebf94074c4 26-Jun-2009 Dianne Hackborn <hackbod@google.com> Expand support for different screen sizes.

Applications can now declare that they support small, normal, or
large screens. Resource selection can also be done based on these
sizes. By default, pre-Donut apps are false for small and large,
and Donut or later apps are assumed to support all sizes. In either
case they can use <supports-screens> in their manifest to declare
what they actually support.
/frameworks/base/core/java/android/content/pm/PackageParser.java
5c1e00b14d2ef10ec76abf3e951fa8003a67f558 19-Jun-2009 Dianne Hackborn <hackbod@google.com> Fix targetSdkVersion, make resize mode a flag, delayed dexopt, easy ApplicationInfo.

- Fix a bug where targetSdkVersion could not be set if minSdkVersion. Stupid, stupid.
Also make sure to fail if minSdkVersion is for a code name. Really stupid.

- Change the API for resize compatibility mode to be a bit in the flags field, instead
of a separate boolean.

- Implement delayed dexopting, to avoid the looong full dexopt during boot. This is
only enabled for "eng" builds. When in this mode, the activity manager will make
sure that a dexopt has been done before loading an .apk into a process, and will
try to avoid displaying ANRs if they are due to the dexopt causing some operation
to take longer than it normally would (though I make no guarantees about this
totally working).

- Add API to Context to get the ApplicationInfo for its package, for easy access to
things like targetSdkVersion.
/frameworks/base/core/java/android/content/pm/PackageParser.java
d299b8194dde8c4875e5f032918ab35ebad8b1f1 05-Jun-2009 Suchi Amalapurapu <asuchitra@google.com> Add a new attribute to android manifest for defining the GLES version number.
This attribute is parsed by the PackageParser into ConfigurationInfo. The major
and minor version numbers are defined as the higher and lower order bits.
/frameworks/base/core/java/android/content/pm/PackageParser.java
9189cabb0b6c6c28232fe6f412b7ba7a37352a6a 03-Jun-2009 Mitsuru Oshima <oshima@google.com> * Moved supports-density tag under manifest
* Refactored Compatibility code
* Added CompatibilityInfo class
* Removed getApplicationScale from Context
* Added Resources#getCompatibilityInfo so that RootView can get the compatibility info w/o going through Context
* Expandable support
* Added expandable tag under manifest
* Old application w/o expandable is given the default screen size ([320, 480] x density).
* The non-expandable window is centered.
/frameworks/base/core/java/android/content/pm/PackageParser.java
5a3a77dabd744d5be79d7745c2a977c108a9ad98 01-Jun-2009 San Mehat <san@google.com> base: Rename WRITE_SDCARD -> WRITE_EXTERNAL_STORAGE

Signed-off-by: San Mehat <san@google.com>
/frameworks/base/core/java/android/content/pm/PackageParser.java
181fafaf48208978b8ba2022683ffa78aaeddde1 14-May-2009 Christopher Tate <ctate@google.com> Retool the backup process to use a new 'BackupAgent' class

Backups will be handled by launching the application in a special
mode under which no activities or services will be started, only
the BackupAgent subclass named in the app's android:backupAgent
manifest property. This takes the place of the BackupService class
used earlier during development.

In the cases of *full* backup or restore, an application that does
not supply its own BackupAgent will be launched in a restricted
manner; in particular, it will be using the default Application
class rather than any manifest-declared one. This ensures that the
app is not running any code that may try to manipulate its data
while the backup system reads/writes its data set.
/frameworks/base/core/java/android/content/pm/PackageParser.java
45515659438964ec47f4feac247f0e9dce587c86 24-Apr-2009 Jaikumar Ganesh <jaikumar@google.com> Enforce permissions for PhoneStateListener events.

PhoneStateListener events like LISTEN_CALL_STATE_CHANGED,
have privacy information like phone numbers and hence,
need to be protected with a permission. The permission
READ_PHONE_STATE is used for this purpose. Use the permission
trick to ensure backward compatability.
/frameworks/base/core/java/android/content/pm/PackageParser.java
a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3d 14-May-2009 Dianne Hackborn <hackbod@google.com> Implement compatibility support for WRITE_SDCARD permission.

Now old applications will automatically be granted it. Also renamed it from
SDCARD_WRITE to WRITE_SDCARD to be consistent with our other permissions,
and re-arranged how we do targetSdkVersion to actually be usuable for this
kind of stuff.

Note that right now this results in basically all apps being given the
WRITE_SDCARD permission, because their targetSdkVersion is not set. I will
be dealing with that in a future change.
/frameworks/base/core/java/android/content/pm/PackageParser.java
e7fe35b88aa77766d322b8a683995a2bdae6210d 13-May-2009 Dianne Hackborn <hackbod@google.com> Whoops fix installing. I am dumb.
/frameworks/base/core/java/android/content/pm/PackageParser.java
ade3ecad94d1f4431576f53bae26c35efbf7a2c9 12-May-2009 Dianne Hackborn <hackbod@google.com> Implement issue #1783881 (manifest option for adb-install-only apps)

You can now use android:testOnly="true" to not allow your .apk to be installed
as a normal app. The only way to do so is with the pm command and giving the
-t option, which sets a new INSTALL_ALLOW_TEST flag when installing.

I also used this to clean up the install API... actually, mostly to hide
it, since it is not accessible to apps so shouldn't be in the SDK. We
will be doing some more work on it, so this will prevent adding yet
another backwards-compatibility-for-no-reason version.
/frameworks/base/core/java/android/content/pm/PackageParser.java
851a54143c15a1c33361efae2db3f7f45059b472 08-May-2009 Dianne Hackborn <hackbod@google.com> Implement targetSdkVersion and maxSdkVersion, plus version code names.

This adds new attributes for specifying a targetSdkVersion and maxSdkVersion.
There is a new ApplicationInfo flag that is set if the application has set
its targetSdkVersion to the current platform or later. Also you can now
use a string for minSdkVersion and targetSdkVerion, to indicate you are
building against a development tree instead of an official platform.
/frameworks/base/core/java/android/content/pm/PackageParser.java
257eef353dfc9519b63e3fe2616505c5534b460a 27-Apr-2009 Mitsuru Oshima <> Merge branch 'readonly-p4-donut' into donut
8d112675879a2b83197d3b4ae4fb623abd1a1ec3 27-Apr-2009 Mitsuru Oshima <> AI 147845: Compatibility mode support. Part 1
Adding supports-density tag to manifest file/ApplicationInfo.
BUG=1752478

Automated import of CL 147845
/frameworks/base/core/java/android/content/pm/PackageParser.java
1d442e0d990b581357f33f5463c7c5cb49b551e8 21-Apr-2009 Dianne Hackborn <hackbod@google.com> More optimization of dumpsys output.

There are three major classes of changes here:

- Avoid writing lines where their values are often empty, false, or some other typical thing.
- Use partial writes to the PrintWriter to avoid creating temporary strings.
- Use StringBuilder where we need to generate real String objects (and where possible cache the result).
/frameworks/base/core/java/android/content/pm/PackageParser.java
b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54 09-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@137197
/frameworks/base/core/java/android/content/pm/PackageParser.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/content/pm/PackageParser.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/content/pm/PackageParser.java
3001a035439d8134a7d70d796376d1dfbff3cdcd 19-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@132276
/frameworks/base/core/java/android/content/pm/PackageParser.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/android/content/pm/PackageParser.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/content/pm/PackageParser.java