Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6069beb2 authored by Suchi Amalapurapu's avatar Suchi Amalapurapu
Browse files

Rename ApplicationInfo.FLAG_ON_SDCARD to ApplicationInfo.FLAG_EXTERNAL_STORAGE

    Change-Id: Iadef9f9bb2851c38b6d79be1bafbf932abce4210

Change-Id: I2e412bace3d8005db5057a3497bd836d0038b90c
parent a8fbe1fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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(
+8 −8
Original line number Diff line number Diff line
@@ -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<String> appList = mSettings.findPackagesWithFlag(ApplicationInfo.FLAG_ON_SDCARD);
           Set<String> 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);
+4 −4
Original line number Diff line number Diff line
@@ -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);