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

Commit dcc7fb21 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents ceac819b 5c33663b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);
        }