diff options
Diffstat (limited to 'src')
4 files changed, 45 insertions, 0 deletions
diff --git a/src/com/android/providers/contacts/CallLogProvider.java b/src/com/android/providers/contacts/CallLogProvider.java index 8202241..39b9c34 100644 --- a/src/com/android/providers/contacts/CallLogProvider.java +++ b/src/com/android/providers/contacts/CallLogProvider.java @@ -36,6 +36,7 @@ import android.database.sqlite.SQLiteQueryBuilder; import android.net.Uri; import android.provider.CallLog; import android.provider.CallLog.Calls; +import android.util.Log; import java.util.HashMap; @@ -92,6 +93,9 @@ public class CallLogProvider extends ContentProvider { @Override public boolean onCreate() { + if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { + Log.d(Constants.PERFORMANCE_TAG, "CallLogProvider.onCreate start"); + } final Context context = getContext(); mDbHelper = getDatabaseHelper(context); mUseStrictPhoneNumberComparation = @@ -99,6 +103,9 @@ public class CallLogProvider extends ContentProvider { com.android.internal.R.bool.config_use_strict_phone_number_comparation); mVoicemailPermissions = new VoicemailPermissions(context); mCallLogInsertionHelper = createCallLogInsertionHelper(context); + if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { + Log.d(Constants.PERFORMANCE_TAG, "CallLogProvider.onCreate finish"); + } return true; } diff --git a/src/com/android/providers/contacts/Constants.java b/src/com/android/providers/contacts/Constants.java new file mode 100644 index 0000000..8cf28e6 --- /dev/null +++ b/src/com/android/providers/contacts/Constants.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ +package com.android.providers.contacts; + +public class Constants { + private Constants() {} + + // Log tag for performance measurement. + // To enable: adb shell setprop log.tag.ContactsPerf VERBOSE + public static final String PERFORMANCE_TAG = "ContactsPerf"; +} diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java index 0bbedb7..e96ef35 100644 --- a/src/com/android/providers/contacts/ContactsProvider2.java +++ b/src/com/android/providers/contacts/ContactsProvider2.java @@ -1329,12 +1329,19 @@ public class ContactsProvider2 extends SQLiteContentProvider implements OnAccoun @Override public boolean onCreate() { + if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { + Log.d(Constants.PERFORMANCE_TAG, "ContactsProvider2.onCreate start"); + } super.onCreate(); try { return initialize(); } catch (RuntimeException e) { Log.e(TAG, "Cannot start provider", e); return false; + } finally { + if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { + Log.d(Constants.PERFORMANCE_TAG, "ContactsProvider2.onCreate finish"); + } } } diff --git a/src/com/android/providers/contacts/VoicemailContentProvider.java b/src/com/android/providers/contacts/VoicemailContentProvider.java index 4aabc44..1dde287 100644 --- a/src/com/android/providers/contacts/VoicemailContentProvider.java +++ b/src/com/android/providers/contacts/VoicemailContentProvider.java @@ -36,6 +36,7 @@ import android.os.ParcelFileDescriptor; import android.provider.BaseColumns; import android.provider.VoicemailContract; import android.provider.VoicemailContract.Voicemails; +import android.util.Log; import java.io.FileNotFoundException; import java.util.List; @@ -56,12 +57,18 @@ public class VoicemailContentProvider extends ContentProvider @Override public boolean onCreate() { + if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { + Log.d(Constants.PERFORMANCE_TAG, "VoicemailContentProvider.onCreate start"); + } Context context = context(); mVoicemailPermissions = new VoicemailPermissions(context); mVoicemailContentTable = new VoicemailContentTable(Tables.CALLS, context, getDatabaseHelper(context), this, createCallLogInsertionHelper(context)); mVoicemailStatusTable = new VoicemailStatusTable(Tables.VOICEMAIL_STATUS, context, getDatabaseHelper(context), this); + if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { + Log.d(Constants.PERFORMANCE_TAG, "VoicemailContentProvider.onCreate finish"); + } return true; } |