summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorZoey Chen <zoeychen@google.com>2019-11-20 04:23:26 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-11-20 04:23:26 +0000
commit449aef490544982d6f8a5c18ef46b59fe59c8db2 (patch)
treeb59fa9b4ffc514ad7556c7e690f8133273b204db /src/com
parent919a0f23d91b5ae0680d51602c444f5e41364fd8 (diff)
parent1431dfb91b1e023a59f00560d05e804cbfceaa0e (diff)
downloadplatform_packages_services_Mms-449aef490544982d6f8a5c18ef46b59fe59c8db2.tar.gz
platform_packages_services_Mms-449aef490544982d6f8a5c18ef46b59fe59c8db2.tar.bz2
platform_packages_services_Mms-449aef490544982d6f8a5c18ef46b59fe59c8db2.zip
Merge "[Telephony mainline] Move the functionality about block number into the calling locations."
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/mms/service/SendRequest.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/com/android/mms/service/SendRequest.java b/src/com/android/mms/service/SendRequest.java
index 8446646..b2c5673 100644
--- a/src/com/android/mms/service/SendRequest.java
+++ b/src/com/android/mms/service/SendRequest.java
@@ -127,8 +127,7 @@ public class SendRequest extends MmsRequest {
@Override
protected Void doInBackground(Void... voids) {
try {
- BlockedNumberContract.SystemContract
- .notifyEmergencyContact(mContext);
+ notifyEmergencyContact(mContext);
} catch (Exception e) {
LogUtil.e(getRequestId(),
"Exception notifying emergency contact: " + e);
@@ -447,4 +446,19 @@ public class SendRequest extends MmsRequest {
LogUtil.e("Unexpected onDownloadMmsComplete call with result: " + result);
}
}
+
+ /**
+ * Notifies the provider that emergency services were contacted by the user.
+ */
+ private void notifyEmergencyContact(Context context) {
+ try {
+ LogUtil.i("notifyEmergencyContact; caller=%s", context.getOpPackageName());
+ context.getContentResolver().call(
+ BlockedNumberContract.AUTHORITY_URI, BlockedNumberContract.METHOD_NOTIFY_EMERGENCY_CONTACT, null, null);
+ } catch (NullPointerException | IllegalArgumentException ex) {
+ // The content resolver can throw an NPE or IAE; we don't want to crash Telecom if
+ // either of these happen.
+ LogUtil.w(null, "notifyEmergencyContact: provider not ready.");
+ }
+ }
}