Add counter for predictive info for hush gesture
Test: adb shell settings get secure hush_gesture_used
Test: adb shell settings get secure manual_ringer_toggle_count
Change-Id: Id4feeefa03a5951c03b09ab466a6c399d8aadd0e
Fixes: 79537757
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
index 6b322c7..d76b7f0 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
@@ -36,6 +36,7 @@
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.KeyguardManager;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -445,6 +446,7 @@
}
}
Events.writeEvent(mContext, Events.EVENT_RINGER_TOGGLE, newRingerMode);
+ incrementManualToggleCount();
updateRingerH();
provideTouchFeedbackH(newRingerMode);
mController.setRingerMode(newRingerMode, false);
@@ -453,6 +455,11 @@
updateRingerH();
}
+ private void incrementManualToggleCount() {
+ ContentResolver cr = mContext.getContentResolver();
+ int ringerCount = Settings.Secure.getInt(cr, Settings.Secure.MANUAL_RINGER_TOGGLE_COUNT, 0);
+ Settings.Secure.putInt(cr, Settings.Secure.MANUAL_RINGER_TOGGLE_COUNT, ringerCount + 1);
+ }
private void provideTouchFeedbackH(int newRingerMode) {
VibrationEffect effect = null;