OSDN Git Service

Schematize ADB system properties
authorKiyoung Kim <kiyoungkim@google.com>
Thu, 27 Dec 2018 05:29:54 +0000 (14:29 +0900)
committerKiyoung Kim <kiyoungkim@google.com>
Tue, 12 Feb 2019 02:58:22 +0000 (02:58 +0000)
Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.

Bug: 117924132
Test: m -j
Change-Id: I654c0e1f234d097a66f79ba8c019b8bebc794816
Merged-In: I654c0e1f234d097a66f79ba8c019b8bebc794816

services/usb/java/com/android/server/usb/UsbDeviceManager.java

index 7ea61e3..da682c6 100644 (file)
@@ -69,6 +69,7 @@ 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;
@@ -285,7 +286,7 @@ public class UsbDeviceManager implements ActivityManagerInternal.ScreenObserver
         }
         mControlFds.put(UsbManager.FUNCTION_PTP, ptpFd);
 
-        boolean secureAdbEnabled = SystemProperties.getBoolean("ro.adb.secure", false);
+        boolean secureAdbEnabled = AdbProperties.secure().orElse(false);
         boolean dataEncrypted = "1".equals(VoldProperties.decrypt().orElse(""));
         if (secureAdbEnabled && !dataEncrypted) {
             mDebuggingManager = new UsbDebuggingManager(context);