diff options
author | Alex Klyubin <klyubin@google.com> | 2015-02-03 11:12:59 -0800 |
---|---|---|
committer | Alex Klyubin <klyubin@google.com> | 2015-02-11 11:06:40 -0800 |
commit | b9f8a5204a1b0b3919fa921e858d04124c582828 (patch) | |
tree | c4faa0b3e8d1db30fc8a2deb3bb13b38de5a9364 /services/backup | |
parent | 3fbbe396faffeec6b46796087ad1e075e9a21f0d (diff) | |
download | frameworks_base-b9f8a5204a1b0b3919fa921e858d04124c582828.zip frameworks_base-b9f8a5204a1b0b3919fa921e858d04124c582828.tar.gz frameworks_base-b9f8a5204a1b0b3919fa921e858d04124c582828.tar.bz2 |
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
Diffstat (limited to 'services/backup')
-rw-r--r-- | services/backup/java/com/android/server/backup/BackupManagerService.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index fea1a7a..a55f55d 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -1855,7 +1855,8 @@ public class BackupManagerService extends IBackupManager.Stub { boolean tryBindTransport(ServiceInfo info) { try { PackageInfo packInfo = mPackageManager.getPackageInfo(info.packageName, 0); - if ((packInfo.applicationInfo.flags & ApplicationInfo.FLAG_PRIVILEGED) != 0) { + if ((packInfo.applicationInfo.privateFlags & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) + != 0) { return bindTransport(info); } else { Slog.w(TAG, "Transport package " + info.packageName + " not privileged"); @@ -3107,7 +3108,7 @@ public class BackupManagerService extends IBackupManager.Stub { final boolean isSharedStorage = pkg.packageName.equals(SHARED_BACKUP_AGENT_PACKAGE); final boolean sendApk = mIncludeApks && !isSharedStorage - && ((app.flags & ApplicationInfo.FLAG_FORWARD_LOCK) == 0) + && ((app.privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) == 0) && ((app.flags & ApplicationInfo.FLAG_SYSTEM) == 0 || (app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0); |