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

Commit c2ff2ec0 authored by Andy Stadler's avatar Andy Stadler Committed by Android (Google) Code Review
Browse files

Merge "Read actual device encryption status" into honeycomb

parents 50065738 0fe45dea
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import android.os.RemoteCallback;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Settings;
import android.util.PrintWriterPrinter;
import android.util.Printer;
@@ -1925,8 +1926,15 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
     * {@link DevicePolicyManager#ENCRYPTION_STATUS_ACTIVE}.
     */
    private int getEncryptionStatus() {
        String status = SystemProperties.get("ro.crypto.state", "unsupported");
        if ("encrypted".equalsIgnoreCase(status)) {
            return DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE;
        } else if ("unencrypted".equalsIgnoreCase(status)) {
            return DevicePolicyManager.ENCRYPTION_STATUS_INACTIVE;
        } else {
            return DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED;
        }
    }

    /**
     * Hook to low-levels:  If needed, record the new admin setting for encryption.