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

Commit 49934cc6 authored by Gaurav Kashyap's avatar Gaurav Kashyap Committed by Michael Bestas
Browse files

pm: Add flags for UFS card for encryption in vold

Add flags in Package Manager to pass information to
vold to use ICE for encryption in case of UFS Card.

CRs-Fixed:2491182

Change-Id: I6cb9419bf47619b855a4888e15f6fdb8fc8307ab
parent a4c2978e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ public class DiskInfo implements Parcelable {
    public static final int FLAG_DEFAULT_PRIMARY = 1 << 1;
    public static final int FLAG_SD = 1 << 2;
    public static final int FLAG_USB = 1 << 3;
    public static final int FLAG_EMMC = 1 << 4;
    public static final int FLAG_UFS_CARD = 1 << 5;

    public final String id;
    @UnsupportedAppUsage
+6 −3
Original line number Diff line number Diff line
@@ -22725,7 +22725,7 @@ public class PackageManagerService extends IPackageManager.Stub
        final UserManager um = mContext.getSystemService(UserManager.class);
        UserManagerInternal umInternal = getUserManagerInternal();
        for (UserInfo user : um.getUsers()) {
            final int flags;
            int flags = 0;
            if (umInternal.isUserUnlockingOrUnlocked(user.id)) {
                flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE;
            } else if (umInternal.isUserRunning(user.id)) {
@@ -22733,9 +22733,12 @@ public class PackageManagerService extends IPackageManager.Stub
            } else {
                continue;
            }
            if ((vol.disk.flags & DiskInfo.FLAG_UFS_CARD) == DiskInfo.FLAG_UFS_CARD) {
                flags = flags | DiskInfo.FLAG_UFS_CARD;
            }
            final int pflags = flags;
            try {
                sm.prepareUserStorage(volumeUuid, user.id, user.serialNumber, flags);
                sm.prepareUserStorage(volumeUuid, user.id, user.serialNumber, pflags);
                synchronized (mInstallLock) {
                    reconcileAppsDataLI(volumeUuid, user.id, flags, true /* migrateAppData */);
                }