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

Commit 34e90b22 authored by Craig Mautner's avatar Craig Mautner
Browse files

Do not display ADB confirm dialog during boot

Wait until after encrypted volume has been mounted.
Also eliminate warning by starting UsbDebuggingActivity as owner.

Fixes bug 19217173.

Change-Id: I6da530259bb02eb1892509ec5085a471f9893714
parent b2a958fd
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ import android.os.FileUtils;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.util.Slog;
import android.util.Base64;
import com.android.server.FgThread;
@@ -206,6 +208,12 @@ public class UsbDebuggingManager implements Runnable {
                    break;

                case MESSAGE_ADB_CONFIRM: {
                    if ("trigger_restart_min_framework".equals(
                            SystemProperties.get("vold.decrypt"))) {
                        Slog.d(TAG, "Deferring adb confirmation until after vold decrypt");
                        sendResponse("NO");
                        break;
                    }
                    String key = (String)msg.obj;
                    String fingerprints = getFingerprints(key);
                    if ("".equals(fingerprints)) {
@@ -279,7 +287,7 @@ public class UsbDebuggingManager implements Runnable {
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        if (packageManager.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null) {
            try {
                mContext.startActivity(intent);
                mContext.startActivityAsUser(intent, UserHandle.OWNER);
                return true;
            } catch (ActivityNotFoundException e) {
                Slog.e(TAG, "unable to start adb whitelist activity: " + componentName, e);