Merge "Catch exception from TelephonyManager#isEmergencyNumber to avoid crash" into tm-qpr-dev am: 197e7ec432
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21407019 Change-Id: I03d75f01c5d0b8b291c498a1568bc621832d6f96 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.server.location.injector;
|
package com.android.server.location.injector;
|
||||||
|
|
||||||
|
import static com.android.server.location.LocationManagerService.TAG;
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -23,6 +25,7 @@ import android.content.IntentFilter;
|
|||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.telephony.TelephonyCallback;
|
import android.telephony.TelephonyCallback;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.android.server.FgThread;
|
import com.android.server.FgThread;
|
||||||
|
|
||||||
@@ -67,8 +70,12 @@ public class SystemEmergencyHelper extends EmergencyHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized (SystemEmergencyHelper.this) {
|
synchronized (SystemEmergencyHelper.this) {
|
||||||
|
try {
|
||||||
mIsInEmergencyCall = mTelephonyManager.isEmergencyNumber(
|
mIsInEmergencyCall = mTelephonyManager.isEmergencyNumber(
|
||||||
intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER));
|
intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER));
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
Log.w(TAG, "Failed to call TelephonyManager.isEmergencyNumber().", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, new IntentFilter(Intent.ACTION_NEW_OUTGOING_CALL));
|
}, new IntentFilter(Intent.ACTION_NEW_OUTGOING_CALL));
|
||||||
|
|||||||
Reference in New Issue
Block a user