summaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/providers/contacts/StandaloneContactsProvider2.java
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2014-08-07 10:14:46 -0700
committerMakoto Onuki <omakoto@google.com>2014-08-08 18:55:53 +0000
commit9701936fadaf55ef773dd07015b35f99fd5f8a91 (patch)
treefa47b466c7d02017de411b0de9c9867abbae212f /tests/src/com/android/providers/contacts/StandaloneContactsProvider2.java
parentad847316fe64c958b65bc05eb736e704bc56b23f (diff)
downloadpackages_providers_ContactsProvider-9701936fadaf55ef773dd07015b35f99fd5f8a91.zip
packages_providers_ContactsProvider-9701936fadaf55ef773dd07015b35f99fd5f8a91.tar.gz
packages_providers_ContactsProvider-9701936fadaf55ef773dd07015b35f99fd5f8a91.tar.bz2
Add unit tests for enterprise caller-id
Also fix a few issues: - Fix projection map for phone_lookup/enterprise and add PHOTO_FILE_ID - Null out custom ringtones from the corp CP2. Returning rintones in the corp profile really doesn't make sense. - Fix a log in queryPhoneLookupEnterprise(). Change-Id: If0617225228c526d4b7d87e9c95f6fbe090242a0
Diffstat (limited to 'tests/src/com/android/providers/contacts/StandaloneContactsProvider2.java')
-rw-r--r--tests/src/com/android/providers/contacts/StandaloneContactsProvider2.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/src/com/android/providers/contacts/StandaloneContactsProvider2.java b/tests/src/com/android/providers/contacts/StandaloneContactsProvider2.java
new file mode 100644
index 0000000..a55072c
--- /dev/null
+++ b/tests/src/com/android/providers/contacts/StandaloneContactsProvider2.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2014 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;
+
+import android.content.Context;
+
+/**
+ * A subclass of {@link SynchronousContactsProvider2} that doesn't reuse the database helper.
+ */
+public class StandaloneContactsProvider2 extends SynchronousContactsProvider2 {
+ private static ContactsDatabaseHelper mDbHelper;
+
+ public StandaloneContactsProvider2() {
+ // No need to wipe data for this instance since it doesn't reuse the db helper.
+ setDataWipeEnabled(false);
+ }
+
+ @Override
+ protected ContactsDatabaseHelper getDatabaseHelper(final Context context) {
+ if (mDbHelper == null) {
+ mDbHelper = ContactsDatabaseHelper.getNewInstanceForTest(context);
+ }
+ return mDbHelper;
+ }
+
+ @Override
+ public void setDataWipeEnabled(boolean flag) {
+ // No need to wipe data for this instance since it doesn't reuse the db helper.
+ super.setDataWipeEnabled(false);
+ }
+}