Merge "Schematize ADB system properties" into stage-aosp-master

This commit is contained in:
TreeHugger Robot
2019-02-14 17:52:01 +00:00
committed by Android (Google) Code Review

View File

@@ -69,6 +69,8 @@ import android.os.storage.StorageVolume;
import android.provider.Settings;
import android.service.usb.UsbDeviceManagerProto;
import android.service.usb.UsbHandlerProto;
import android.sysprop.AdbProperties;
import android.sysprop.VoldProperties;
import android.util.Pair;
import android.util.Slog;
@@ -284,8 +286,8 @@ public class UsbDeviceManager implements ActivityManagerInternal.ScreenObserver
}
mControlFds.put(UsbManager.FUNCTION_PTP, ptpFd);
boolean secureAdbEnabled = SystemProperties.getBoolean("ro.adb.secure", false);
boolean dataEncrypted = "1".equals(SystemProperties.get("vold.decrypt"));
boolean secureAdbEnabled = AdbProperties.secure().orElse(false);
boolean dataEncrypted = "1".equals(VoldProperties.decrypt().orElse(""));
if (secureAdbEnabled && !dataEncrypted) {
mDebuggingManager = new UsbDebuggingManager(context);
}