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

Commit 517bc0c8 authored by Varun Shah's avatar Varun Shah Committed by Android (Google) Code Review
Browse files

Merge "Hide the Perform Backup Tasks Settings page." into main

parents 07b384fe a5593de4
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