Revert "Add sensitivity configuration to long press power dialog"

This reverts commit de2f00df41.

Reason for revert: This CL will cause build break, b/197290948

Change-Id: Ibee2d4bc5e445e863585c291b4b2741bcb4b4c81
This commit is contained in:
Sam Chang
2021-08-20 06:46:33 +00:00
parent de2f00df41
commit c4084d4141
12 changed files with 61 additions and 568 deletions

View File

@@ -16,23 +16,30 @@
package com.android.settings.gestures;
import static com.android.settings.gestures.PowerMenuSettingsUtils.LONG_PRESS_POWER_ASSISTANT_VALUE;
import static com.android.settings.gestures.PowerMenuSettingsUtils.LONG_PRESS_POWER_GLOBAL_ACTIONS;
import android.content.Context;
import android.provider.Settings;
import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
public class PowerMenuPreferenceController extends BasePreferenceController {
private static final String POWER_BUTTON_LONG_PRESS_SETTING =
Settings.Global.POWER_BUTTON_LONG_PRESS;
@VisibleForTesting
static final int LONG_PRESS_POWER_GLOBAL_ACTIONS = 1;
@VisibleForTesting
static final int LONG_PRESS_POWER_ASSISTANT_VALUE = 5;
public PowerMenuPreferenceController(Context context, String key) {
super(context, key);
}
@Override
public CharSequence getSummary() {
final int powerButtonValue = PowerMenuSettingsUtils.getPowerButtonSettingValue(mContext);
final int powerButtonValue = getPowerButtonLongPressValue(mContext);
if (powerButtonValue == LONG_PRESS_POWER_ASSISTANT_VALUE) {
return mContext.getText(R.string.power_menu_summary_long_press_for_assist_enabled);
} else if (powerButtonValue == LONG_PRESS_POWER_GLOBAL_ACTIONS) {
@@ -53,4 +60,11 @@ public class PowerMenuPreferenceController extends BasePreferenceController {
return mContext.getResources().getBoolean(
com.android.internal.R.bool.config_longPressOnPowerForAssistantSettingAvailable);
}
private static int getPowerButtonLongPressValue(Context context) {
return Settings.Global.getInt(context.getContentResolver(),
POWER_BUTTON_LONG_PRESS_SETTING,
context.getResources().getInteger(
com.android.internal.R.integer.config_longPressOnPowerBehavior));
}
}