diff options
| author | TheScarastic <warabhishek@gmail.com> | 2020-06-21 08:03:30 +0000 |
|---|---|---|
| committer | TheScarastic <warabhishek@gmail.com> | 2020-06-21 08:12:49 +0000 |
| commit | 5dfefe309d52c053ff1ca42ba831f2669d6ea9b2 (patch) | |
| tree | 20704c40a1809d058d0d0fe073463007067d7ab4 | |
| parent | 5c8a8f3752347788963d16e2cdebbaf53e7f0e5c (diff) | |
plugins: Use SystemUI context for prefs
Change-Id: Iff4e338427bc4488fa3a45e6bccc46879678793b
4 files changed, 18 insertions, 18 deletions
diff --git a/AospPanel/src/co/potatoproject/plugin/volume/aosp/VolumeDialogImpl.java b/AospPanel/src/co/potatoproject/plugin/volume/aosp/VolumeDialogImpl.java index d9cf553..3aca7c0 100644 --- a/AospPanel/src/co/potatoproject/plugin/volume/aosp/VolumeDialogImpl.java +++ b/AospPanel/src/co/potatoproject/plugin/volume/aosp/VolumeDialogImpl.java @@ -618,7 +618,7 @@ public class VolumeDialogImpl implements VolumeDialog { mRingerIcon.setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_POLITE); mRingerIcon.setOnClickListener(v -> { rescheduleTimeoutH(); - Prefs.putBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, true); + Prefs.putBoolean(mSysUIContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, true); final StreamState ss = mState.states.get(AudioManager.STREAM_RING); if (ss == null) { return; @@ -691,7 +691,7 @@ public class VolumeDialogImpl implements VolumeDialog { .setStartDelay(DIALOG_SHOW_ANIMATION_DURATION) .withEndAction(() -> { if (D.BUG) Log.d(TAG, "tool:checkODICaptionsTooltip() putBoolean true"); - Prefs.putBoolean(mContext, + Prefs.putBoolean(mSysUIContext, Prefs.Key.HAS_SEEN_ODI_CAPTIONS_TOOLTIP, true); mHasSeenODICaptionsTooltip = true; if (mODICaptionsIcon != null) { @@ -778,7 +778,7 @@ public class VolumeDialogImpl implements VolumeDialog { } private void maybeShowToastH(int newRingerMode) { - int seenToastCount = Prefs.getInt(mContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, 0); + int seenToastCount = Prefs.getInt(mSysUIContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, 0); if (seenToastCount > VolumePrefs.SHOW_RINGER_TOAST_COUNT) { return; @@ -805,7 +805,7 @@ public class VolumeDialogImpl implements VolumeDialog { Toast.makeText(mContext, toastText, Toast.LENGTH_SHORT).show(); seenToastCount++; - Prefs.putInt(mContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, seenToastCount); + Prefs.putInt(mSysUIContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, seenToastCount); } public void show(int reason) { @@ -845,7 +845,7 @@ public class VolumeDialogImpl implements VolumeDialog { } }) .withEndAction(() -> { - if (!Prefs.getBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, false)) { + if (!Prefs.getBoolean(mSysUIContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, false)) { if (mRingerIcon != null) { mRingerIcon.postOnAnimationDelayed( getSinglePressFor(mRingerIcon), 1500); diff --git a/CompactPanel/src/co/potatoproject/plugin/volume/compact/VolumeDialogImpl.java b/CompactPanel/src/co/potatoproject/plugin/volume/compact/VolumeDialogImpl.java index ee9a36a..969f5f0 100644 --- a/CompactPanel/src/co/potatoproject/plugin/volume/compact/VolumeDialogImpl.java +++ b/CompactPanel/src/co/potatoproject/plugin/volume/compact/VolumeDialogImpl.java @@ -624,7 +624,7 @@ public class VolumeDialogImpl implements VolumeDialog { mRingerIcon.setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_POLITE); mRingerIcon.setOnClickListener(v -> { rescheduleTimeoutH(); - Prefs.putBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, true); + Prefs.putBoolean(mSysUIContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, true); final StreamState ss = mState.states.get(AudioManager.STREAM_RING); if (ss == null) { return; @@ -697,7 +697,7 @@ public class VolumeDialogImpl implements VolumeDialog { .setStartDelay(DIALOG_SHOW_ANIMATION_DURATION) .withEndAction(() -> { if (D.BUG) Log.d(TAG, "tool:checkODICaptionsTooltip() putBoolean true"); - Prefs.putBoolean(mContext, + Prefs.putBoolean(mSysUIContext, Prefs.Key.HAS_SEEN_ODI_CAPTIONS_TOOLTIP, true); mHasSeenODICaptionsTooltip = true; if (mODICaptionsIcon != null) { @@ -851,7 +851,7 @@ public class VolumeDialogImpl implements VolumeDialog { } private void maybeShowToastH(int newRingerMode) { - int seenToastCount = Prefs.getInt(mContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, 0); + int seenToastCount = Prefs.getInt(mSysUIContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, 0); if (seenToastCount > VolumePrefs.SHOW_RINGER_TOAST_COUNT) { return; @@ -878,7 +878,7 @@ public class VolumeDialogImpl implements VolumeDialog { Toast.makeText(mContext, toastText, Toast.LENGTH_SHORT).show(); seenToastCount++; - Prefs.putInt(mContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, seenToastCount); + Prefs.putInt(mSysUIContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, seenToastCount); } public void show(int reason) { @@ -917,7 +917,7 @@ public class VolumeDialogImpl implements VolumeDialog { } }) .withEndAction(() -> { - if (!Prefs.getBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, false)) { + if (!Prefs.getBoolean(mSysUIContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, false)) { if (mRingerIcon != null) { mRingerIcon.postOnAnimationDelayed( getSinglePressFor(mRingerIcon), 1500); diff --git a/OreoPanel/src/co/potatoproject/plugin/volume/oreo/VolumeDialogImpl.java b/OreoPanel/src/co/potatoproject/plugin/volume/oreo/VolumeDialogImpl.java index 6e8c6ef..332a907 100644 --- a/OreoPanel/src/co/potatoproject/plugin/volume/oreo/VolumeDialogImpl.java +++ b/OreoPanel/src/co/potatoproject/plugin/volume/oreo/VolumeDialogImpl.java @@ -628,7 +628,7 @@ public class VolumeDialogImpl implements VolumeDialog { mRingerIcon.setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_POLITE); mRingerIcon.setOnClickListener(v -> { rescheduleTimeoutH(); - Prefs.putBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, true); + Prefs.putBoolean(mSysUIContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, true); final StreamState ss = mState.states.get(AudioManager.STREAM_RING); if (ss == null) { return; @@ -687,7 +687,7 @@ public class VolumeDialogImpl implements VolumeDialog { } private void maybeShowToastH(int newRingerMode) { - int seenToastCount = Prefs.getInt(mContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, 0); + int seenToastCount = Prefs.getInt(mSysUIContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, 0); if (seenToastCount > VolumePrefs.SHOW_RINGER_TOAST_COUNT) { return; @@ -714,7 +714,7 @@ public class VolumeDialogImpl implements VolumeDialog { Toast.makeText(mContext, toastText, Toast.LENGTH_SHORT).show(); seenToastCount++; - Prefs.putInt(mContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, seenToastCount); + Prefs.putInt(mSysUIContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, seenToastCount); } protected void updateRingerH() { diff --git a/TiledPanel/src/co/potatoproject/plugin/volume/tiled/VolumeDialogImpl.java b/TiledPanel/src/co/potatoproject/plugin/volume/tiled/VolumeDialogImpl.java index d9f1e66..9deff63 100644 --- a/TiledPanel/src/co/potatoproject/plugin/volume/tiled/VolumeDialogImpl.java +++ b/TiledPanel/src/co/potatoproject/plugin/volume/tiled/VolumeDialogImpl.java @@ -711,7 +711,7 @@ public class VolumeDialogImpl implements VolumeDialog { mRingerIcon.setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_POLITE); mRingerIcon.setOnClickListener(v -> { rescheduleTimeoutH(); - Prefs.putBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, true); + Prefs.putBoolean(mSysUIContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, true); final StreamState ss = mState.states.get(AudioManager.STREAM_RING); if (ss == null) { return; @@ -785,7 +785,7 @@ public class VolumeDialogImpl implements VolumeDialog { .setStartDelay(DIALOG_SHOW_ANIMATION_DURATION) .withEndAction(() -> { if (D.BUG) Log.d(TAG, "tool:checkODICaptionsTooltip() putBoolean true"); - Prefs.putBoolean(mContext, + Prefs.putBoolean(mSysUIContext, Prefs.Key.HAS_SEEN_ODI_CAPTIONS_TOOLTIP, true); mHasSeenODICaptionsTooltip = true; if (mODICaptionsIcon != null) { @@ -872,7 +872,7 @@ public class VolumeDialogImpl implements VolumeDialog { } private void maybeShowToastH(int newRingerMode) { - int seenToastCount = Prefs.getInt(mContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, 0); + int seenToastCount = Prefs.getInt(mSysUIContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, 0); if (seenToastCount > VolumePrefs.SHOW_RINGER_TOAST_COUNT) { return; @@ -899,7 +899,7 @@ public class VolumeDialogImpl implements VolumeDialog { Toast.makeText(mContext, toastText, Toast.LENGTH_SHORT).show(); seenToastCount++; - Prefs.putInt(mContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, seenToastCount); + Prefs.putInt(mSysUIContext, Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT, seenToastCount); } public void show(int reason) { @@ -938,7 +938,7 @@ public class VolumeDialogImpl implements VolumeDialog { } }) .withEndAction(() -> { - if (!Prefs.getBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, false)) { + if (!Prefs.getBoolean(mSysUIContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, false)) { if (mRingerIcon != null) { mRingerIcon.postOnAnimationDelayed( getSinglePressFor(mRingerIcon), 1500); |
