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

Commit a5593de4 authored by Varun Shah's avatar Varun Shah
Browse files

Hide the Perform Backup Tasks Settings page.

Since we are now hiding the new RUN_BACKUP_JOBS permission, hide the
associated special app access page in Settings.

Bug: 331272951
Test: BackupTasksAppsPreferenceControllerTest
Test: visual (Settings pages)
Change-Id: I875b286798f48ee4e94d5e37c1b21bb84acf390d
parent 6a3bd880
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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>
+1 −4
Original line number Diff line number Diff line
@@ -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) {
+2 −1
Original line number Diff line number Diff line
@@ -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