Loading src/com/android/contacts/ContactsApplication.java +10 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.contacts; import com.android.contacts.model.AccountTypeManager; import com.android.contacts.test.InjectedServices; import com.android.contacts.util.Constants; import com.google.common.annotations.VisibleForTesting; import android.app.Application; Loading @@ -27,9 +28,9 @@ import android.content.Context; import android.content.SharedPreferences; import android.os.StrictMode; import android.preference.PreferenceManager; import android.util.Log; public final class ContactsApplication extends Application { private static InjectedServices sInjectedServices; private AccountTypeManager mAccountTypeManager; private ContactPhotoManager mContactPhotoManager; Loading Loading @@ -100,6 +101,10 @@ public final class ContactsApplication extends Application { public void onCreate() { super.onCreate(); if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "ContactsApplication.onCreate start"); } // Priming caches to placate the StrictMode police Context context = getApplicationContext(); PreferenceManager.getDefaultSharedPreferences(context); Loading @@ -108,5 +113,9 @@ public final class ContactsApplication extends Application { StrictMode.setThreadPolicy( new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build()); if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "ContactsApplication.onCreate finish"); } } } src/com/android/contacts/activities/PeopleActivity.java +7 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ import com.android.contacts.preference.ContactsPreferenceActivity; import com.android.contacts.preference.DisplayOptionsPreferenceFragment; import com.android.contacts.util.AccountSelectionUtil; import com.android.contacts.util.AccountsListAdapter; import com.android.contacts.util.Constants; import com.android.contacts.util.DialogManager; import com.android.contacts.util.PhoneCapabilityTester; Loading Loading @@ -233,6 +234,9 @@ public class PeopleActivity extends ContactsActivity @Override protected void onCreate(Bundle savedState) { if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "PeopleActivity.onCreate start"); } super.onCreate(savedState); if (!processIntent(false)) { Loading @@ -242,6 +246,9 @@ public class PeopleActivity extends ContactsActivity mIsRecreatedInstance = (savedState != null); createViewsAndFragments(savedState); if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "PeopleActivity.onCreate finish"); } } @Override Loading src/com/android/contacts/model/AccountTypeManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.contacts.model; import com.android.contacts.util.Constants; import com.android.i18n.phonenumbers.PhoneNumberUtil; import com.android.internal.util.Objects; import com.google.android.collect.Lists; Loading Loading @@ -271,6 +272,9 @@ class AccountTypeManagerImpl extends AccountTypeManager * called on a background thread. */ protected void loadAccountsInBackground() { if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "AccountTypeManager.loadAccountsInBackground start"); } long startTime = SystemClock.currentThreadTimeMillis(); // Account types, keyed off the account type and data set concatenation. Loading Loading @@ -419,6 +423,9 @@ class AccountTypeManagerImpl extends AccountTypeManager mInitializationLatch.countDown(); mInitializationLatch = null; } if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "AccountTypeManager.loadAccountsInBackground finish"); } } // Bookkeeping method for tracking the known account types in the given maps. Loading src/com/android/contacts/util/Constants.java +4 −0 Original line number Diff line number Diff line Loading @@ -24,4 +24,8 @@ public class Constants { public static final String SCHEME_MAILTO = "mailto"; public static final String SCHEME_IMTO = "imto"; public static final String SCHEME_SIP = "sip"; // Log tag for performance measurement. // To enable: adb shell setprop log.tag.ContactsPerf VERBOSE public static final String PERFORMANCE_TAG = "ContactsPerf"; } Loading
src/com/android/contacts/ContactsApplication.java +10 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.contacts; import com.android.contacts.model.AccountTypeManager; import com.android.contacts.test.InjectedServices; import com.android.contacts.util.Constants; import com.google.common.annotations.VisibleForTesting; import android.app.Application; Loading @@ -27,9 +28,9 @@ import android.content.Context; import android.content.SharedPreferences; import android.os.StrictMode; import android.preference.PreferenceManager; import android.util.Log; public final class ContactsApplication extends Application { private static InjectedServices sInjectedServices; private AccountTypeManager mAccountTypeManager; private ContactPhotoManager mContactPhotoManager; Loading Loading @@ -100,6 +101,10 @@ public final class ContactsApplication extends Application { public void onCreate() { super.onCreate(); if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "ContactsApplication.onCreate start"); } // Priming caches to placate the StrictMode police Context context = getApplicationContext(); PreferenceManager.getDefaultSharedPreferences(context); Loading @@ -108,5 +113,9 @@ public final class ContactsApplication extends Application { StrictMode.setThreadPolicy( new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build()); if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "ContactsApplication.onCreate finish"); } } }
src/com/android/contacts/activities/PeopleActivity.java +7 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ import com.android.contacts.preference.ContactsPreferenceActivity; import com.android.contacts.preference.DisplayOptionsPreferenceFragment; import com.android.contacts.util.AccountSelectionUtil; import com.android.contacts.util.AccountsListAdapter; import com.android.contacts.util.Constants; import com.android.contacts.util.DialogManager; import com.android.contacts.util.PhoneCapabilityTester; Loading Loading @@ -233,6 +234,9 @@ public class PeopleActivity extends ContactsActivity @Override protected void onCreate(Bundle savedState) { if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "PeopleActivity.onCreate start"); } super.onCreate(savedState); if (!processIntent(false)) { Loading @@ -242,6 +246,9 @@ public class PeopleActivity extends ContactsActivity mIsRecreatedInstance = (savedState != null); createViewsAndFragments(savedState); if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "PeopleActivity.onCreate finish"); } } @Override Loading
src/com/android/contacts/model/AccountTypeManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.contacts.model; import com.android.contacts.util.Constants; import com.android.i18n.phonenumbers.PhoneNumberUtil; import com.android.internal.util.Objects; import com.google.android.collect.Lists; Loading Loading @@ -271,6 +272,9 @@ class AccountTypeManagerImpl extends AccountTypeManager * called on a background thread. */ protected void loadAccountsInBackground() { if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "AccountTypeManager.loadAccountsInBackground start"); } long startTime = SystemClock.currentThreadTimeMillis(); // Account types, keyed off the account type and data set concatenation. Loading Loading @@ -419,6 +423,9 @@ class AccountTypeManagerImpl extends AccountTypeManager mInitializationLatch.countDown(); mInitializationLatch = null; } if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "AccountTypeManager.loadAccountsInBackground finish"); } } // Bookkeeping method for tracking the known account types in the given maps. Loading
src/com/android/contacts/util/Constants.java +4 −0 Original line number Diff line number Diff line Loading @@ -24,4 +24,8 @@ public class Constants { public static final String SCHEME_MAILTO = "mailto"; public static final String SCHEME_IMTO = "imto"; public static final String SCHEME_SIP = "sip"; // Log tag for performance measurement. // To enable: adb shell setprop log.tag.ContactsPerf VERBOSE public static final String PERFORMANCE_TAG = "ContactsPerf"; }