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

Commit eccafdf6 authored by Christopher R. Palmer's avatar Christopher R. Palmer Committed by Gerrit Code Review
Browse files

apps2sd: Only allow "move to ___" if the media is mounted [2/2]

Change-Id: I025e595fbc6303f2586c5bf74f3d1fba564d4c76
parent 6ca26516
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -333,6 +333,17 @@ public class PackageHelper {
        return false;
    }

    /**
     * Is there storage mounted that would be possible to consider for
     * installing to an external media?
     */
    public static boolean isExternalInstallPossible() {
        return (!Environment.isExternalStorageEmulated() &&
            Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) ||
            (Environment.isNoEmulatedStorageExist() &&
            Environment.MEDIA_MOUNTED.equals(Environment.getSecondaryStorageState()));
    }

    /**
     * Given a requested {@link PackageInfo#installLocation} and calculated
     * install size, pick the actual location to install the app.