Merge "Import revised translations."
diff --git a/src/com/android/contacts/quickcontact/QuickContactWindow.java b/src/com/android/contacts/quickcontact/QuickContactWindow.java
index bbb928d..5ec8dc7 100644
--- a/src/com/android/contacts/quickcontact/QuickContactWindow.java
+++ b/src/com/android/contacts/quickcontact/QuickContactWindow.java
@@ -623,7 +623,7 @@
* Handle the result from the {@link #TOKEN_DATA} query.
*/
private void handleData(Cursor cursor) {
- final ResolveCache cache = ResolveCache.getInstance(mContext.getPackageManager());
+ final ResolveCache cache = ResolveCache.getInstance(mContext);
if (cursor == null) return;
if (cursor.getCount() == 0) {
Toast.makeText(mContext, R.string.invalidContactMessage, Toast.LENGTH_LONG).show();
diff --git a/src/com/android/contacts/quickcontact/ResolveCache.java b/src/com/android/contacts/quickcontact/ResolveCache.java
index 5d84253..2b9e92f 100644
--- a/src/com/android/contacts/quickcontact/ResolveCache.java
+++ b/src/com/android/contacts/quickcontact/ResolveCache.java
@@ -16,14 +16,17 @@
package com.android.contacts.quickcontact;
+import com.android.contacts.util.PhoneCapabilityTester;
import com.google.android.collect.Sets;
+import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
+import android.provider.ContactsContract.CommonDataKinds.SipAddress;
import android.text.TextUtils;
import java.lang.ref.SoftReference;
@@ -51,6 +54,7 @@
"com.android.phone",
"com.android.browser");
+ private final Context mContext;
private final PackageManager mPackageManager;
private static ResolveCache sInstance;
@@ -59,9 +63,9 @@
* Returns an instance of the ResolveCache. Only one internal instance is kept, so
* the argument packageManagers is ignored for all but the first call
*/
- public synchronized static ResolveCache getInstance(PackageManager packageManager) {
+ public synchronized static ResolveCache getInstance(Context context) {
if (sInstance == null) {
- return sInstance = new ResolveCache(packageManager);
+ return sInstance = new ResolveCache(context.getApplicationContext());
}
return sInstance;
}
@@ -81,8 +85,10 @@
private HashMap<String, Entry> mCache = new HashMap<String, Entry>();
- private ResolveCache(PackageManager packageManager) {
- mPackageManager = packageManager;
+
+ private ResolveCache(Context context) {
+ mContext = context;
+ mPackageManager = context.getPackageManager();
}
/**
@@ -95,7 +101,12 @@
if (entry != null) return entry;
entry = new Entry();
- final Intent intent = action.getIntent();
+ Intent intent = action.getIntent();
+ if (SipAddress.CONTENT_ITEM_TYPE.equals(mimeType)
+ && !PhoneCapabilityTester.isSipPhone(mContext)) {
+ intent = null;
+ }
+
if (intent != null) {
final List<ResolveInfo> matches = mPackageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
diff --git a/src/com/android/contacts/vcard/ExportProcessor.java b/src/com/android/contacts/vcard/ExportProcessor.java
index 3285a05..67c9c4a 100644
--- a/src/com/android/contacts/vcard/ExportProcessor.java
+++ b/src/com/android/contacts/vcard/ExportProcessor.java
@@ -109,7 +109,7 @@
final String errorReason =
mService.getString(R.string.fail_reason_could_not_open_file,
uri, e.getMessage());
- doFinishNotification(errorReason, "");
+ doFinishNotification(errorReason, null);
return;
}
@@ -139,7 +139,7 @@
final String title =
mService.getString(R.string.fail_reason_could_not_initialize_exporter,
translatedErrorReason);
- doFinishNotification(title, "");
+ doFinishNotification(title, null);
return;
}
@@ -147,7 +147,7 @@
if (total == 0) {
final String title =
mService.getString(R.string.fail_reason_no_exportable_contact);
- doFinishNotification(title, "");
+ doFinishNotification(title, null);
return;
}
@@ -165,7 +165,7 @@
final String title =
mService.getString(R.string.fail_reason_error_occurred_during_export,
translatedErrorReason);
- doFinishNotification(title, "");
+ doFinishNotification(title, null);
return;
}
@@ -187,7 +187,7 @@
final String filename = uri.getLastPathSegment();
final String title = mService.getString(R.string.exporting_vcard_finished_title,
filename);
- doFinishNotification(title, "");
+ doFinishNotification(title, null);
} finally {
if (composer != null) {
composer.terminate();
diff --git a/src/com/android/contacts/vcard/ImportProcessor.java b/src/com/android/contacts/vcard/ImportProcessor.java
index 1b70025..4ea1ead 100644
--- a/src/com/android/contacts/vcard/ImportProcessor.java
+++ b/src/com/android/contacts/vcard/ImportProcessor.java
@@ -198,7 +198,7 @@
}
final Notification notification =
VCardService.constructFinishNotification(mService,
- description, description, intent);
+ description, null, intent);
mNotificationManager.notify(mJobId, notification);
}