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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user