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

Commit 99d9e946 authored by d34d's avatar d34d Committed by Abhisek Devkota
Browse files

Exclude themes from being moved to external storage

Currently, bad things happen when you move a theme to the external
storage, especially if it's currently applied.  For now it's best
to exclude these apks from being moved.

Change-Id: Ife7c29f549eee6aba742f3a25f45b3752c6bda66
parent 9fa03b36
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ public class InstalledAppDetails extends Fragment
        } else {
            mMoveAppButton.setText(R.string.move_app_to_sdcard);
            mCanBeOnSdCardChecker.init();
            moveDisable = !mCanBeOnSdCardChecker.check(mAppEntry.info);
            moveDisable = !mCanBeOnSdCardChecker.check(mPackageInfo);
        }
        if (moveDisable || mAppControlRestricted) {
            mMoveAppButton.setEnabled(false);
+5 −5
Original line number Diff line number Diff line
@@ -100,14 +100,14 @@ final class CanBeOnSdCardChecker {
        }
    }
    
    boolean check(ApplicationInfo info) {
    boolean check(PackageInfo info) {
        boolean canBe = false;
        if (!PackageHelper.isExternalInstallPossible()) {
            // Don't even bother checking the other cases, no media is available
        } else if ((info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
        if (info.isThemeApk || !PackageHelper.isExternalInstallPossible()) {
            // Don't even bother checking the other cases, no media is available or it's a theme
        } else if ((info.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
            canBe = true;
        } else {
            if ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
            if ((info.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
                if (info.installLocation == PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL ||
                        info.installLocation == PackageInfo.INSTALL_LOCATION_AUTO) {
                    canBe = true;