From 29f9abcd8bf5bf54dbf37502670156e074ad5f47 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 30 Apr 2024 19:50:29 +0000 Subject: [PATCH] Add Device Diagnostics to Settings. The new option will only appear if (1) the flag is enabled and (2) DeviceDiagnostics.apk is landed on the device (which it is by default on AOSP). Bug: 309886423 Test: Build AOSP Pixel and launch Settings Change-Id: If01d231664a301ff289d4da61445bf65a7506fdb --- ...gs_device_diagnostics_declarations.aconfig | 9 +++ res/drawable/ic_device_diagnostics.xml | 10 +++ res/values/config.xml | 3 + res/values/strings.xml | 5 ++ res/xml/system_dashboard_fragment.xml | 7 ++ .../DeviceDiagnosticsPreferenceController.kt | 65 +++++++++++++++++++ 6 files changed, 99 insertions(+) create mode 100644 aconfig/settings_device_diagnostics_declarations.aconfig create mode 100644 res/drawable/ic_device_diagnostics.xml create mode 100644 src/com/android/settings/system/DeviceDiagnosticsPreferenceController.kt diff --git a/aconfig/settings_device_diagnostics_declarations.aconfig b/aconfig/settings_device_diagnostics_declarations.aconfig new file mode 100644 index 00000000000..90a12dbb9ab --- /dev/null +++ b/aconfig/settings_device_diagnostics_declarations.aconfig @@ -0,0 +1,9 @@ +package: "com.android.settings.flags" +container: "system_ext" + +flag { + name: "enable_device_diagnostics_in_settings" + namespace: "phoenix" + description: "Enable the Device Diagnostics app in Settings" + bug: "309886423" +} diff --git a/res/drawable/ic_device_diagnostics.xml b/res/drawable/ic_device_diagnostics.xml new file mode 100644 index 00000000000..26953a70314 --- /dev/null +++ b/res/drawable/ic_device_diagnostics.xml @@ -0,0 +1,10 @@ + + + diff --git a/res/values/config.xml b/res/values/config.xml index 4d3a23348e4..4b638b25552 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -836,4 +836,7 @@ + + + com.android.devicediagnostics diff --git a/res/values/strings.xml b/res/values/strings.xml index 0fee1874cdb..3545fe6d4d7 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -13258,4 +13258,9 @@ Sync across devices + + + + + Device diagnostics diff --git a/res/xml/system_dashboard_fragment.xml b/res/xml/system_dashboard_fragment.xml index 628eab94e4c..6225f4f8382 100644 --- a/res/xml/system_dashboard_fragment.xml +++ b/res/xml/system_dashboard_fragment.xml @@ -97,6 +97,13 @@ android:order="-40" settings:controller="com.android.settings.system.DeveloperOptionsController"/> + +