Loading res/xml/special_access.xml +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ android:key="run_backup_tasks" android:title="@string/run_backup_tasks_title" android:order="-2000" settings:isPreferenceVisible="false" settings:searchable="false" settings:keywords="@string/keywords_run_backup_tasks" settings:controller="com.android.settings.spa.app.specialaccess.BackupTasksAppsPreferenceController"> </Preference> Loading src/com/android/settings/spa/app/specialaccess/BackupTasksAppsPreferenceController.kt +1 −4 Original line number Diff line number Diff line Loading @@ -19,14 +19,11 @@ package com.android.settings.spa.app.specialaccess import android.content.Context import androidx.preference.Preference import com.android.settings.core.BasePreferenceController import com.android.settings.flags.Flags import com.android.settings.spa.SpaActivity.Companion.startSpaActivity class BackupTasksAppsPreferenceController(context: Context, preferenceKey: String) : BasePreferenceController(context, preferenceKey) { override fun getAvailabilityStatus() = if (Flags.enablePerformBackupTasksInSettings()) AVAILABLE else CONDITIONALLY_UNAVAILABLE override fun getAvailabilityStatus() = CONDITIONALLY_UNAVAILABLE override fun handlePreferenceTreeClick(preference: Preference): Boolean { if (preference.key == mPreferenceKey) { Loading tests/spa_unit/src/com/android/settings/spa/app/specialaccess/BackupTasksAppsPreferenceControllerTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,8 @@ class BackupTasksAppsPreferenceControllerTest { @Test @RequiresFlagsEnabled(Flags.FLAG_ENABLE_PERFORM_BACKUP_TASKS_IN_SETTINGS) fun getAvailabilityStatus_enableBackupTasksApps_returnAvailable() { assertThat(controller.isAvailable).isTrue() // Feature is currently disabled so it should return false regardless of flag status. assertThat(controller.isAvailable).isFalse() } @Test Loading Loading
res/xml/special_access.xml +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ android:key="run_backup_tasks" android:title="@string/run_backup_tasks_title" android:order="-2000" settings:isPreferenceVisible="false" settings:searchable="false" settings:keywords="@string/keywords_run_backup_tasks" settings:controller="com.android.settings.spa.app.specialaccess.BackupTasksAppsPreferenceController"> </Preference> Loading
src/com/android/settings/spa/app/specialaccess/BackupTasksAppsPreferenceController.kt +1 −4 Original line number Diff line number Diff line Loading @@ -19,14 +19,11 @@ package com.android.settings.spa.app.specialaccess import android.content.Context import androidx.preference.Preference import com.android.settings.core.BasePreferenceController import com.android.settings.flags.Flags import com.android.settings.spa.SpaActivity.Companion.startSpaActivity class BackupTasksAppsPreferenceController(context: Context, preferenceKey: String) : BasePreferenceController(context, preferenceKey) { override fun getAvailabilityStatus() = if (Flags.enablePerformBackupTasksInSettings()) AVAILABLE else CONDITIONALLY_UNAVAILABLE override fun getAvailabilityStatus() = CONDITIONALLY_UNAVAILABLE override fun handlePreferenceTreeClick(preference: Preference): Boolean { if (preference.key == mPreferenceKey) { Loading
tests/spa_unit/src/com/android/settings/spa/app/specialaccess/BackupTasksAppsPreferenceControllerTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,8 @@ class BackupTasksAppsPreferenceControllerTest { @Test @RequiresFlagsEnabled(Flags.FLAG_ENABLE_PERFORM_BACKUP_TASKS_IN_SETTINGS) fun getAvailabilityStatus_enableBackupTasksApps_returnAvailable() { assertThat(controller.isAvailable).isTrue() // Feature is currently disabled so it should return false regardless of flag status. assertThat(controller.isAvailable).isFalse() } @Test Loading