summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-06-07 19:35:25 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-06-07 19:35:25 +0000
commitc8d58599d7fdcee444e3255104c0043a6f459e43 (patch)
treeb18aaad8180484928b947b25b7bc7aa75410d1a3
parent97f22763f4285d6c2d6148bbe2540036983aec13 (diff)
parent820df85982fb0fd03b966c3fc5a48c8946eaa4ed (diff)
Merge "Removed "last_tab_enabled" flag. END_PUBLIC"
-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) {