Remove "Device Controls" from Settings

Both device controls and wallet have moved to new areas outside of the
power menu. In step 1, we are removing the device controls settings,
as the user can now fully control availability within the new Quick
Settings device controls tile.

Bug: 185597511
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.gestures
Change-Id: Ib9a8c36c0532c095e58bc0ec085b788fc84945d7
This commit is contained in:
Matt Pietal
2021-04-16 15:50:34 -04:00
parent d2bffb94a7
commit 6e8286fbb6
16 changed files with 19 additions and 469 deletions

View File

@@ -17,7 +17,6 @@
package com.android.settings.gestures;
import android.content.Context;
import android.content.pm.PackageManager;
import android.provider.Settings;
import com.android.settings.R;
@@ -26,7 +25,6 @@ import com.android.settings.core.BasePreferenceController;
public class PowerMenuPreferenceController extends BasePreferenceController {
private static final String KEY = "gesture_power_menu_summary";
private static final String CONTROLS_ENABLED_SETTING = Settings.Secure.CONTROLS_ENABLED;
private static final String CARDS_ENABLED_SETTING =
Settings.Secure.GLOBAL_ACTIONS_PANEL_ENABLED;
private static final String CARDS_AVAILABLE_SETTING =
@@ -38,17 +36,10 @@ public class PowerMenuPreferenceController extends BasePreferenceController {
@Override
public CharSequence getSummary() {
boolean controlsVisible = isControlsAvailable()
&& Settings.Secure.getInt(mContext.getContentResolver(),
CONTROLS_ENABLED_SETTING, 1) == 1;
boolean cardsVisible = isCardsAvailable()
&& Settings.Secure.getInt(mContext.getContentResolver(),
CARDS_ENABLED_SETTING, 0) == 1;
if (controlsVisible && cardsVisible) {
return mContext.getText(R.string.power_menu_cards_passes_device_controls);
} else if (controlsVisible) {
return mContext.getText(R.string.power_menu_device_controls);
} else if (cardsVisible) {
if (cardsVisible) {
return mContext.getText(R.string.power_menu_cards_passes);
} else {
return mContext.getText(R.string.power_menu_none);
@@ -57,14 +48,10 @@ public class PowerMenuPreferenceController extends BasePreferenceController {
@Override
public int getAvailabilityStatus() {
return isCardsAvailable() || isControlsAvailable() || isAssistInvocationAvailable()
return isCardsAvailable() || isAssistInvocationAvailable()
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
}
private boolean isControlsAvailable() {
return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CONTROLS);
}
private boolean isCardsAvailable() {
return Settings.Secure.getInt(mContext.getContentResolver(),
CARDS_AVAILABLE_SETTING, 0) == 1;