summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/main
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2018-06-07 10:50:11 -0700
committerCopybara-Service <copybara-piper@google.com>2018-06-07 11:04:40 -0700
commit820df85982fb0fd03b966c3fc5a48c8946eaa4ed (patch)
treeb18aaad8180484928b947b25b7bc7aa75410d1a3 /java/com/android/dialer/main
parent97f22763f4285d6c2d6148bbe2540036983aec13 (diff)
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
Diffstat (limited to 'java/com/android/dialer/main')
-rw-r--r--java/com/android/dialer/main/impl/OldMainActivityPeer.java25
1 files changed, 10 insertions, 15 deletions
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) {