summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2013-05-01 22:47:16 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-01 22:47:16 +0000
commiteed8411c8cc1f163ba06a928e3b4b6d3f1045282 (patch)
treeff149da9b46bd6229ff7266b0d9d1258d710a0a3
parent48f2b548edf8e276cc89d2c4c2d2936cde46fc95 (diff)
parent3335644f7ae060c170f457ebf8c61622f56ae9a7 (diff)
downloadframeworks_base-eed8411c8cc1f163ba06a928e3b4b6d3f1045282.zip
frameworks_base-eed8411c8cc1f163ba06a928e3b4b6d3f1045282.tar.gz
frameworks_base-eed8411c8cc1f163ba06a928e3b4b6d3f1045282.tar.bz2
Merge "Bootstrap installed system apps only when the target user is running" into jb-mr2-dev
-rw-r--r--services/java/com/android/server/pm/PackageManagerService.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index fcea9e7..ada600d 100644
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -6055,7 +6055,6 @@ public class PackageManagerService extends IPackageManager.Stub {
long callingId = Binder.clearCallingIdentity();
try {
boolean sendAdded = false;
- boolean isSystem = false;
Bundle extras = new Bundle(1);
// writer
@@ -6069,28 +6068,29 @@ public class PackageManagerService extends IPackageManager.Stub {
mSettings.writePackageRestrictionsLPr(userId);
extras.putInt(Intent.EXTRA_UID, UserHandle.getUid(userId, pkgSetting.appId));
sendAdded = true;
- isSystem = (pkgSetting.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0;
}
}
if (sendAdded) {
sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED,
packageName, extras, null, null, new int[] {userId});
- if (isSystem) {
- // The just-installed/enabled app is bundled on the system, so presumed
- // to be able to run automatically without needing an explicit launch.
- // Send it a BOOT_COMPLETED if it would ordinarily have gotten one.
- Intent bcIntent = new Intent(Intent.ACTION_BOOT_COMPLETED)
- .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
- .setPackage(packageName);
- try {
- IActivityManager am = ActivityManagerNative.getDefault();
+ try {
+ IActivityManager am = ActivityManagerNative.getDefault();
+ final boolean isSystem =
+ isSystemApp(pkgSetting) || isUpdatedSystemApp(pkgSetting);
+ if (isSystem && am.isUserRunning(userId, false)) {
+ // The just-installed/enabled app is bundled on the system, so presumed
+ // to be able to run automatically without needing an explicit launch.
+ // Send it a BOOT_COMPLETED if it would ordinarily have gotten one.
+ Intent bcIntent = new Intent(Intent.ACTION_BOOT_COMPLETED)
+ .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
+ .setPackage(packageName);
am.broadcastIntent(null, bcIntent, null, null, 0, null, null, null,
android.app.AppOpsManager.OP_NONE, false, false, userId);
- } catch (RemoteException e) {
- // shouldn't happen
- Slog.w(TAG, "Unable to bootstrap installed package", e);
}
+ } catch (RemoteException e) {
+ // shouldn't happen
+ Slog.w(TAG, "Unable to bootstrap installed package", e);
}
}
} finally {