Merge "Move contacts package name to resource string." into lmp-dev
diff --git a/tests/res/values/donottranslate_config.xml b/tests/res/values/donottranslate_config.xml
new file mode 100644
index 0000000..9931d85
--- /dev/null
+++ b/tests/res/values/donottranslate_config.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <string name="target_package_name">com.android.contacts</string>
+
+</resources>
diff --git a/tests/src/com/android/contacts/ContactsLaunchPerformance.java b/tests/src/com/android/contacts/ContactsLaunchPerformance.java
index 5f0336b..411ba4e 100644
--- a/tests/src/com/android/contacts/ContactsLaunchPerformance.java
+++ b/tests/src/com/android/contacts/ContactsLaunchPerformance.java
@@ -31,8 +31,8 @@
public void onCreate(Bundle arguments) {
mIntent.setAction(Intent.ACTION_MAIN);
mIntent.addCategory(Intent.CATEGORY_LAUNCHER);
- mIntent.setComponent(new ComponentName("com.android.contacts",
- "com.android.contacts.DialtactsContactsEntryActivity"));
+ mIntent.setComponent(new ComponentName(getTargetContext(),
+ "com.android.contacts.activities.PeopleActivity"));
start();
}
diff --git a/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java b/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java
index 9cbc534..910fb5c 100644
--- a/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java
+++ b/tests/src/com/android/contacts/tests/allintents/AllIntentsActivity.java
@@ -61,7 +61,7 @@
implements SelectAccountDialogFragment.Listener {
/** The name of the package of the contacts application. */
- private static final String ANDROID_CONTACTS_PACKAGE = "com.android.contacts";
+ private String mContactsPackageName;
private static final String CONTACT_LIST_ACTIVITY_CLASS_NAME =
"com.android.contacts.activities.PeopleActivity";
@@ -140,6 +140,8 @@
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this, R.layout.intent_list_item,
getResources().getStringArray(R.array.allIntents)));
+ mContactsPackageName = getResources().getString(
+ R.string.target_package_name);
}
@Override
@@ -559,7 +561,8 @@
/** Creates an intent that is bound to a specific activity by name. */
private Intent bindIntentToClass(Intent intent, String activityClassName) {
- intent.setComponent(new ComponentName(ANDROID_CONTACTS_PACKAGE, activityClassName));
+ intent.setComponent(new ComponentName(mContactsPackageName,
+ activityClassName));
return intent;
}
diff --git a/tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java b/tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java
index 613665a..46a1f43 100644
--- a/tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java
+++ b/tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java
@@ -76,7 +76,8 @@
private void startActivity(int[] counts, String[] names, boolean[] headers,
boolean[] showIfEmpty, int[] delays) {
Intent intent = new Intent();
- intent.setComponent(new ComponentName("com.android.contacts",
+ intent.setComponent(new ComponentName(
+ getResources().getString(R.string.target_package_name),
"com.android.contacts.widget.PinnedHeaderListDemoActivity"));
intent.putExtra("counts", counts);
intent.putExtra("names", names);