From fc445ff5f76cd084e9197dcb6c904a30a731a89f Mon Sep 17 00:00:00 2001 From: Muntashir Al-Islam Date: Sat, 13 Apr 2024 12:28:51 +0600 Subject: [PATCH] [Ops] Fix displaying wireless debugging options Prompt user to select an action (pair, connect, cancel) when it's unable to enable Wireless Debugging. Signed-off-by: Muntashir Al-Islam --- .../io/github/muntashirakon/AppManager/settings/Ops.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/github/muntashirakon/AppManager/settings/Ops.java b/app/src/main/java/io/github/muntashirakon/AppManager/settings/Ops.java index f80f3292080..c3c0d815743 100644 --- a/app/src/main/java/io/github/muntashirakon/AppManager/settings/Ops.java +++ b/app/src/main/java/io/github/muntashirakon/AppManager/settings/Ops.java @@ -259,9 +259,12 @@ public static int init(@NonNull Context context, boolean force) { throw new Exception("Wifi not enabled."); } if (AdbUtils.enableWirelessDebugging(context)) { + // Wireless debugging enabled, try auto-connect return STATUS_AUTO_CONNECT_WIRELESS_DEBUGGING; + } else { + // Wireless debugging is turned off or there's no permission + return STATUS_WIRELESS_DEBUGGING_CHOOSER_REQUIRED; } - Log.w(TAG, "Could not ensure wireless debugging, falling back..."); } // else fallback to ADB over TCP case MODE_ADB_OVER_TCP: sIsRoot = sIsSystem = false;