summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer/app/calllog/CallLogAdapter.java
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2017-10-27 16:47:14 -0700
committerEric Erfanian <erfanian@google.com>2017-10-30 08:32:29 -0700
commitf87dbfbf35f996738cb3f5436b654f615b1c1b27 (patch)
treee93fb2211413e5feede15d81c9aa5c19b2f84d0c /java/com/android/dialer/app/calllog/CallLogAdapter.java
parent77cb8e5d86ebca9763cd06b5263dc02203576f40 (diff)
downloadandroid_packages_apps_Dialer-f87dbfbf35f996738cb3f5436b654f615b1c1b27.tar.gz
android_packages_apps_Dialer-f87dbfbf35f996738cb3f5436b654f615b1c1b27.tar.bz2
android_packages_apps_Dialer-f87dbfbf35f996738cb3f5436b654f615b1c1b27.zip
Roll forward cl/172154863: Do not load every DialtactsActivity fragment on app open
With this change we now only load the Favorites and Call Log Fragments when the app opens. Paging to the CallLogFragment makes the ContactsFragment load as we would want. This should result in a faster app start time. I'll need to verify the impact of this using the same method as http://cl/170422671 I verified the change in behavior by adding my own log line to the onCreate of each Fragment. I saw all of them get created before the change, and only the expected 2 with this change. This change also fixes flaky test of voicemailTabVisibleNotVisible_volumeStreamCorrect. Bug: 64541209,65460373,67297718 Test: DialtactsActivityIntegrationTest PiperOrigin-RevId: 173734472 Change-Id: Ifd4a3064a6fdcffe5a373eaad6ee4aeebdadda1e
Diffstat (limited to 'java/com/android/dialer/app/calllog/CallLogAdapter.java')
-rw-r--r--java/com/android/dialer/app/calllog/CallLogAdapter.java44
1 files changed, 23 insertions, 21 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java
index 589029827..47ef32d42 100644
--- a/java/com/android/dialer/app/calllog/CallLogAdapter.java
+++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java
@@ -610,29 +610,31 @@ public class CallLogAdapter extends GroupingListAdapter
// Restoring multi selected entries
ArrayList<String> listOfSelectedItems =
savedInstanceState.getStringArrayList(KEY_ACTION_MODE);
- LogUtil.i(
- "CallLogAdapter.onRestoreInstanceState",
- "restored selectedItemsList:%d",
- listOfSelectedItems.size());
-
- if (!listOfSelectedItems.isEmpty()) {
- for (int i = 0; i < listOfSelectedItems.size(); i++) {
- String voicemailUri = listOfSelectedItems.get(i);
- int id = getVoicemailId(voicemailUri);
+ if (listOfSelectedItems != null) {
+ LogUtil.i(
+ "CallLogAdapter.onRestoreInstanceState",
+ "restored selectedItemsList:%d",
+ listOfSelectedItems.size());
+
+ if (!listOfSelectedItems.isEmpty()) {
+ for (int i = 0; i < listOfSelectedItems.size(); i++) {
+ String voicemailUri = listOfSelectedItems.get(i);
+ int id = getVoicemailId(voicemailUri);
+ LogUtil.i(
+ "CallLogAdapter.onRestoreInstanceState",
+ "restoring selected index %d, id=%d, uri=%s ",
+ i,
+ id,
+ voicemailUri);
+ selectedItems.put(id, voicemailUri);
+ }
+
LogUtil.i(
- "CallLogAdapter.onRestoreInstanceState",
- "restoring selected index %d, id=%d, uri=%s ",
- i,
- id,
- voicemailUri);
- selectedItems.put(id, voicemailUri);
+ "CallLogAdapter.onRestoreInstance",
+ "restored selectedItems %s",
+ selectedItems.toString());
+ updateActionBar();
}
-
- LogUtil.i(
- "CallLogAdapter.onRestoreInstance",
- "restored selectedItems %s",
- selectedItems.toString());
- updateActionBar();
}
}
}