diff options
author | Tracy Zhou <tracyzhou@google.com> | 2018-05-04 18:10:48 -0700 |
---|---|---|
committer | Tracy Zhou <tracyzhou@google.com> | 2018-05-09 11:00:20 -0700 |
commit | 04bf5480380da5a91a10deec97c08ce2e43f35a3 (patch) | |
tree | cecd332b1dd2ded414613fd40fca3c8f94fa6fa0 | |
parent | dfd07389e3603b7849f9f26758b018cda5ddc08a (diff) | |
download | android_packages_apps_Trebuchet-04bf5480380da5a91a10deec97c08ce2e43f35a3.tar.gz android_packages_apps_Trebuchet-04bf5480380da5a91a10deec97c08ce2e43f35a3.tar.bz2 android_packages_apps_Trebuchet-04bf5480380da5a91a10deec97c08ce2e43f35a3.zip |
Reset home bounce as unseen for users upgrading from Android O/N to P.
Change-Id: I18b80f874180c8cc94e3101bcbceb75ecd4c28bc
Fixes: 78647939
Test: Manual test
-rw-r--r-- | quickstep/src/com/android/quickstep/OverviewInteractionState.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/quickstep/src/com/android/quickstep/OverviewInteractionState.java b/quickstep/src/com/android/quickstep/OverviewInteractionState.java index c552cffad..9416a2976 100644 --- a/quickstep/src/com/android/quickstep/OverviewInteractionState.java +++ b/quickstep/src/com/android/quickstep/OverviewInteractionState.java @@ -36,6 +36,8 @@ import android.support.annotation.WorkerThread; import android.util.Log; import com.android.launcher3.MainThreadExecutor; +import com.android.launcher3.Utilities; +import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.util.UiThreadHelper; import com.android.systemui.shared.recents.ISystemUiProxy; @@ -55,6 +57,8 @@ public class OverviewInteractionState { private static final String TAG = "OverviewFlags"; + private static final String HAS_ENABLED_QUICKSTEP_ONCE = "launcher.has_enabled_quickstep_once"; + // We do not need any synchronization for this variable as its only written on UI thread. private static OverviewInteractionState INSTANCE; @@ -80,6 +84,7 @@ public class OverviewInteractionState { private final SwipeUpGestureEnabledSettingObserver mSwipeUpSettingObserver; + private final Context mContext; private final Handler mUiHandler; private final Handler mBgHandler; @@ -91,6 +96,7 @@ public class OverviewInteractionState { private Runnable mOnSwipeUpSettingChangedListener; private OverviewInteractionState(Context context) { + mContext = context; mUiHandler = new Handler(this::handleUiMessage); mBgHandler = new Handler(UiThreadHelper.getBackgroundLooper(), this::handleBgMessage); @@ -133,6 +139,8 @@ public class OverviewInteractionState { break; case MSG_SET_SWIPE_UP_ENABLED: mSwipeUpEnabled = msg.arg1 != 0; + resetHomeBounceSeenOnQuickstepEnabledFirstTime(); + if (mOnSwipeUpSettingChangedListener != null) { mOnSwipeUpSettingChangedListener.run(); } @@ -179,6 +187,7 @@ public class OverviewInteractionState { mResolver.registerContentObserver(Settings.Secure.getUriFor(SWIPE_UP_SETTING_NAME), false, this); mSwipeUpEnabled = getValue(); + resetHomeBounceSeenOnQuickstepEnabledFirstTime(); } @Override @@ -201,4 +210,14 @@ public class OverviewInteractionState { return false; } } + + private void resetHomeBounceSeenOnQuickstepEnabledFirstTime() { + if (mSwipeUpEnabled && !Utilities.getPrefs(mContext).getBoolean( + HAS_ENABLED_QUICKSTEP_ONCE, true)) { + Utilities.getPrefs(mContext).edit() + .putBoolean(HAS_ENABLED_QUICKSTEP_ONCE, true) + .putBoolean(DiscoveryBounce.HOME_BOUNCE_SEEN, false) + .apply(); + } + } } |