From 3d8974723a2f6b11eafbcbac0229d363021de877 Mon Sep 17 00:00:00 2001 From: Michael Groover Date: Tue, 17 Mar 2020 00:06:20 -0700 Subject: [PATCH] Add developer option to disable automatic adb grant revocation Android 10 introduced a security feature to automatically revoke adb authorizations for systems that have not reconnected to the device within 7 days. While this is helpful for consumers that enable adb for a one time task and mistakenly select the 'always allow' option, feedback has indicated having a developer option to disable this feature would be beneficial. Bug: 119510647 Test: make RunSettingsRoboTests ROBOTEST_FILTER=AdbAuthorizationTimeoutPreferenceControllerTest Change-Id: I7eb123e8c69956aa02bb679784ac79650baf5dcb --- res/values/strings.xml | 5 + res/xml/development_settings.xml | 5 + ...horizationTimeoutPreferenceController.java | 79 +++++++++++ .../DevelopmentSettingsDashboardFragment.java | 1 + ...zationTimeoutPreferenceControllerTest.java | 134 ++++++++++++++++++ 5 files changed, 224 insertions(+) create mode 100644 src/com/android/settings/development/AdbAuthorizationTimeoutPreferenceController.java create mode 100644 tests/robotests/src/com/android/settings/development/AdbAuthorizationTimeoutPreferenceControllerTest.java diff --git a/res/values/strings.xml b/res/values/strings.xml index 94972f78f45..de83bf0f7b6 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -10454,6 +10454,11 @@ Quick settings developer tiles + + Disable adb authorization timeout + + Disable automatic revocation of adb authorizations for systems that have not reconnected within the default (7 days) or user-configured (minimum 1 day) amount of time. + Winscope Trace diff --git a/res/xml/development_settings.xml b/res/xml/development_settings.xml index b4d0bba047c..48a0850c7ba 100644 --- a/res/xml/development_settings.xml +++ b/res/xml/development_settings.xml @@ -148,6 +148,11 @@ android:summary="@string/enable_adb_wireless_summary" settings:keywords="@string/keywords_adb_wireless" /> + +