Update summary of Gesture
when quick gesture enabled, update summary to reflect correct status
Bug: 138149556
Test: manual & robotest
Change-Id: I072134cd8327ad5eb1d0862604acef83e1bdcec0
diff --git a/src/com/android/settings/gestures/GesturesSettingPreferenceController.java b/src/com/android/settings/gestures/GesturesSettingPreferenceController.java
index 98eddff..9d4d538 100644
--- a/src/com/android/settings/gestures/GesturesSettingPreferenceController.java
+++ b/src/com/android/settings/gestures/GesturesSettingPreferenceController.java
@@ -20,10 +20,12 @@
import android.content.Context;
import android.hardware.display.AmbientDisplayConfiguration;
import android.provider.Settings;
+import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.android.settings.R;
+import com.android.settings.aware.AwareFeatureProvider;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -33,6 +35,7 @@
public class GesturesSettingPreferenceController extends BasePreferenceController {
private final AssistGestureFeatureProvider mFeatureProvider;
+ private final AwareFeatureProvider mAwareFeatureProvider;
private List<AbstractPreferenceController> mGestureControllers;
private static final String KEY_GESTURES_SETTINGS = "gesture_settings";
@@ -41,6 +44,7 @@
public GesturesSettingPreferenceController(Context context) {
super(context, KEY_GESTURES_SETTINGS);
mFeatureProvider = FeatureFactory.getFactory(context).getAssistGestureFeatureProvider();
+ mAwareFeatureProvider = FeatureFactory.getFactory(context).getAwareFeatureProvider();
}
@Override
@@ -90,8 +94,15 @@
contentResolver, Settings.Secure.ASSIST_GESTURE_ENABLED, 1) != 0;
final boolean assistGestureSilenceEnabled = Settings.Secure.getInt(
contentResolver, Settings.Secure.ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, 1) != 0;
+ final boolean sensorSupported = mFeatureProvider.isSupported(mContext);
- if (mFeatureProvider.isSupported(mContext) && assistGestureEnabled) {
+ final CharSequence awareSummary = mAwareFeatureProvider.getGestureSummary(mContext,
+ sensorSupported, assistGestureEnabled, assistGestureSilenceEnabled);
+ if (!TextUtils.isEmpty(awareSummary)) {
+ return awareSummary;
+ }
+
+ if (sensorSupported && assistGestureEnabled) {
return mContext.getText(
R.string.language_input_gesture_summary_on_with_assist);
}