diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index 8773f59de1001..423f4bcb1623a 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -237,7 +237,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ - public static final int FLAG_ON_SDCARD = 1<<20; + public static final int FLAG_EXTERNAL_STORAGE = 1<<20; /** * Value for {@link #flags}: Set to true if the application is diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 663d9e6050846..9736b017b3964 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -1503,7 +1503,7 @@ public class PackageParser { } if ((flags & PARSE_ON_SDCARD) != 0) { - ai.flags |= ApplicationInfo.FLAG_ON_SDCARD; + ai.flags |= ApplicationInfo.FLAG_EXTERNAL_STORAGE; } if (sa.getBoolean( diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index 371fa372ce5d4..4c1356b6a5138 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -4589,7 +4589,7 @@ class PackageManagerService extends IPackageManager.Stub { } else { // When replacing apps make sure we honour // the existing app location if not overwritten by other options - boolean prevOnSd = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_ON_SDCARD) != 0; + boolean prevOnSd = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0; if (onSd) { // Install flag overrides everything. return PackageHelper.RECOMMEND_INSTALL_EXTERNAL; @@ -5995,7 +5995,7 @@ class PackageManagerService extends IPackageManager.Stub { // Delete application code and resources if (deleteCodeAndResources) { // TODO can pick up from PackageSettings as well - int installFlags = ((p.applicationInfo.flags & ApplicationInfo.FLAG_ON_SDCARD)!=0) ? + int installFlags = ((p.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE)!=0) ? PackageManager.INSTALL_EXTERNAL : 0; installFlags |= ((p.applicationInfo.flags & ApplicationInfo.FLAG_FORWARD_LOCK)!=0) ? PackageManager.INSTALL_FORWARD_LOCK : 0; @@ -7214,7 +7214,7 @@ class PackageManagerService extends IPackageManager.Stub { void setFlags(int pkgFlags) { this.pkgFlags = (pkgFlags & ApplicationInfo.FLAG_SYSTEM) | (pkgFlags & ApplicationInfo.FLAG_FORWARD_LOCK) | - (pkgFlags & ApplicationInfo.FLAG_ON_SDCARD) | + (pkgFlags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) | (pkgFlags & ApplicationInfo.FLAG_NEVER_ENCRYPT); } } @@ -9058,7 +9058,7 @@ class PackageManagerService extends IPackageManager.Stub { return false; } mMediaMounted = mediaStatus; - Set appList = mSettings.findPackagesWithFlag(ApplicationInfo.FLAG_ON_SDCARD); + Set appList = mSettings.findPackagesWithFlag(ApplicationInfo.FLAG_EXTERNAL_STORAGE); ret = appList != null && appList.size() > 0; } // Queue up an async operation since the package installation may take a little while. @@ -9107,7 +9107,7 @@ class PackageManagerService extends IPackageManager.Stub { if (DEBUG_SD_INSTALL) Log.i(TAG, "Looking for pkg : " + pkgName); PackageSetting ps = mSettings.mPackages.get(pkgName); if (ps != null && ps.codePathString != null && - (ps.pkgFlags & ApplicationInfo.FLAG_ON_SDCARD) != 0) { + (ps.pkgFlags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) { if (DEBUG_SD_INSTALL) Log.i(TAG, "Container : " + cid + " corresponds to pkg : " + pkgName + " at code path: " + ps.codePathString); @@ -9333,7 +9333,7 @@ class PackageManagerService extends IPackageManager.Stub { } else { newFlags = (flags & PackageManager.MOVE_EXTERNAL_MEDIA) != 0 ? PackageManager.INSTALL_EXTERNAL : 0; - currFlags = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_ON_SDCARD) != 0 ? + currFlags = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0 ? PackageManager.INSTALL_EXTERNAL : 0; if (newFlags == currFlags) { Log.w(TAG, "No move required. Trying to move to same location"); @@ -9400,9 +9400,9 @@ class PackageManagerService extends IPackageManager.Stub { ps.resourcePathString = ps.resourcePath.getPath(); // Set the application info flag correctly. if ((mp.flags & PackageManager.INSTALL_EXTERNAL) != 0) { - pkg.applicationInfo.flags |= ApplicationInfo.FLAG_ON_SDCARD; + pkg.applicationInfo.flags |= ApplicationInfo.FLAG_EXTERNAL_STORAGE; } else { - pkg.applicationInfo.flags &= ~ApplicationInfo.FLAG_ON_SDCARD; + pkg.applicationInfo.flags &= ~ApplicationInfo.FLAG_EXTERNAL_STORAGE; } ps.setFlags(pkg.applicationInfo.flags); mAppDirs.remove(oldCodePath); diff --git a/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java b/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java index 0b69020f2037f..d4435d35a8f2e 100755 --- a/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java +++ b/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java @@ -315,9 +315,9 @@ public class PackageManagerTests extends AndroidTestCase { if (!getInstallLoc(flags, expInstallLocation)) { assertEquals(srcPath, appInstallPath); assertEquals(publicSrcPath, appInstallPath); - assertFalse((info.flags & ApplicationInfo.FLAG_ON_SDCARD) != 0); + assertFalse((info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0); } else { - assertTrue((info.flags & ApplicationInfo.FLAG_ON_SDCARD) != 0); + assertTrue((info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0); assertTrue(srcPath.startsWith(SECURE_CONTAINERS_PREFIX)); assertTrue(publicSrcPath.startsWith(SECURE_CONTAINERS_PREFIX)); } @@ -1172,9 +1172,9 @@ public class PackageManagerTests extends AndroidTestCase { ApplicationInfo info = getPm().getApplicationInfo(ip.pkg.packageName, 0); assertNotNull(info); if ((moveFlags & PackageManager.MOVE_INTERNAL) != 0) { - assertTrue((info.flags & ApplicationInfo.FLAG_ON_SDCARD) == 0); + assertTrue((info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == 0); } else if ((moveFlags & PackageManager.MOVE_EXTERNAL_MEDIA) != 0){ - assertTrue((info.flags & ApplicationInfo.FLAG_ON_SDCARD) != 0); + assertTrue((info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0); } } else { assertFalse(retCode);