From 820df85982fb0fd03b966c3fc5a48c8946eaa4ed Mon Sep 17 00:00:00 2001 From: zachh Date: Thu, 7 Jun 2018 10:50:11 -0700 Subject: Removed "last_tab_enabled" flag. END_PUBLIC The bottom nav buttons do not work correctly when this flag is not enabled (see bugs). This flag is intended to always be true via an experiment but can be false for example when the user clears data or just launched dialer for the first time and hasn't received config flags. It is not likely that we will ever want to turn off this behavior, so this change simply removes all support for it. TEST=unit Bug: 109762667,79485008 Test: unit PiperOrigin-RevId: 199660314 Change-Id: I105f6c553c7541673b6d5dd7abf4d29f566e155f --- .../dialer/main/impl/OldMainActivityPeer.java | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'java/com/android/dialer') diff --git a/java/com/android/dialer/main/impl/OldMainActivityPeer.java b/java/com/android/dialer/main/impl/OldMainActivityPeer.java index 9169dc323..165d1085c 100644 --- a/java/com/android/dialer/main/impl/OldMainActivityPeer.java +++ b/java/com/android/dialer/main/impl/OldMainActivityPeer.java @@ -441,11 +441,9 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen } else if (isShowTabIntent(intent)) { LogUtil.i("OldMainActivityPeer.onHandleIntent", "Show tab intent"); tabToSelect = getTabFromIntent(intent); - } else if (lastTabController.isEnabled) { + } else { LogUtil.i("OldMainActivityPeer.onHandleIntent", "Show last tab"); tabToSelect = lastTabController.getLastTab(); - } else { - tabToSelect = TabIndex.SPEED_DIAL; } logImpressionForSelectedTab(tabToSelect); bottomNav.selectTab(tabToSelect); @@ -1614,29 +1612,26 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen private final Context context; private final BottomNavBar bottomNavBar; - private final boolean isEnabled; private final boolean canShowVoicemailTab; LastTabController(Context context, BottomNavBar bottomNavBar, boolean canShowVoicemailTab) { this.context = context; this.bottomNavBar = bottomNavBar; - isEnabled = - ConfigProviderComponent.get(context) - .getConfigProvider() - .getBoolean("last_tab_enabled", false); this.canShowVoicemailTab = canShowVoicemailTab; } - /** Sets the last tab if the feature is enabled, otherwise defaults to speed dial. */ + /** + * Get the last tab shown to the user, or the speed dial tab if this is the first time the user + * has opened the app. + */ @TabIndex int getLastTab() { @TabIndex int tabIndex = TabIndex.SPEED_DIAL; - if (isEnabled) { - tabIndex = - StorageComponent.get(context) - .unencryptedSharedPrefs() - .getInt(KEY_LAST_TAB, TabIndex.SPEED_DIAL); - } + + tabIndex = + StorageComponent.get(context) + .unencryptedSharedPrefs() + .getInt(KEY_LAST_TAB, TabIndex.SPEED_DIAL); // If the voicemail tab cannot be shown, default to showing speed dial if (tabIndex == TabIndex.VOICEMAIL && !canShowVoicemailTab) { -- cgit v1.2.3