am 4ef0aabe: Merge "Catch ActivityNotFoundException in quick contacts badge" into klp-dev
* commit '4ef0aabe93877b7f30645b873fbc003651151f2f': Catch ActivityNotFoundException in quick contacts badge
This commit is contained in:
@@ -18,6 +18,7 @@ package android.provider;
|
|||||||
|
|
||||||
import android.accounts.Account;
|
import android.accounts.Account;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ContentProviderClient;
|
import android.content.ContentProviderClient;
|
||||||
import android.content.ContentProviderOperation;
|
import android.content.ContentProviderOperation;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
@@ -40,6 +41,7 @@ import android.text.TextUtils;
|
|||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -7981,7 +7983,7 @@ public final class ContactsContract {
|
|||||||
// Trigger with obtained rectangle
|
// Trigger with obtained rectangle
|
||||||
Intent intent = composeQuickContactsIntent(context, target, lookupUri, mode,
|
Intent intent = composeQuickContactsIntent(context, target, lookupUri, mode,
|
||||||
excludeMimes);
|
excludeMimes);
|
||||||
context.startActivity(intent);
|
startActivityWithErrorToast(context, intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -8014,7 +8016,16 @@ public final class ContactsContract {
|
|||||||
String[] excludeMimes) {
|
String[] excludeMimes) {
|
||||||
Intent intent = composeQuickContactsIntent(context, target, lookupUri, mode,
|
Intent intent = composeQuickContactsIntent(context, target, lookupUri, mode,
|
||||||
excludeMimes);
|
excludeMimes);
|
||||||
context.startActivity(intent);
|
startActivityWithErrorToast(context, intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void startActivityWithErrorToast(Context context, Intent intent) {
|
||||||
|
try {
|
||||||
|
context.startActivity(intent);
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
Toast.makeText(context, com.android.internal.R.string.quick_contacts_not_available,
|
||||||
|
Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2247,6 +2247,10 @@
|
|||||||
<!-- Other SIP address type. Same context as Other phone type. -->
|
<!-- Other SIP address type. Same context as Other phone type. -->
|
||||||
<string name="sipAddressTypeOther">Other</string>
|
<string name="sipAddressTypeOther">Other</string>
|
||||||
|
|
||||||
|
<!-- Error message that is displayed when the user clicks on a quick contacts badge, but
|
||||||
|
there is no contacts application installed that can display the quick contact -->
|
||||||
|
<string name="quick_contacts_not_available">No activity found to view contact.</string>
|
||||||
|
|
||||||
<!-- Instructions telling the user to enter their SIM PIN to unlock the keyguard.
|
<!-- Instructions telling the user to enter their SIM PIN to unlock the keyguard.
|
||||||
Displayed in one line in a large font. -->
|
Displayed in one line in a large font. -->
|
||||||
<string name="keyguard_password_enter_pin_code">Type PIN code</string>
|
<string name="keyguard_password_enter_pin_code">Type PIN code</string>
|
||||||
|
|||||||
@@ -690,6 +690,7 @@
|
|||||||
<java-symbol type="string" name="mobile_provisioning_apn" />
|
<java-symbol type="string" name="mobile_provisioning_apn" />
|
||||||
<java-symbol type="string" name="mobile_provisioning_url" />
|
<java-symbol type="string" name="mobile_provisioning_url" />
|
||||||
<java-symbol type="string" name="mobile_redirected_provisioning_url" />
|
<java-symbol type="string" name="mobile_redirected_provisioning_url" />
|
||||||
|
<java-symbol type="string" name="quick_contacts_not_available" />
|
||||||
<java-symbol type="string" name="reboot_safemode_confirm" />
|
<java-symbol type="string" name="reboot_safemode_confirm" />
|
||||||
<java-symbol type="string" name="reboot_safemode_title" />
|
<java-symbol type="string" name="reboot_safemode_title" />
|
||||||
<java-symbol type="string" name="relationTypeAssistant" />
|
<java-symbol type="string" name="relationTypeAssistant" />
|
||||||
|
|||||||
Reference in New Issue
Block a user