summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Soonil Nagarkar <sooniln@google.com> 2021-09-02 10:45:04 -0700
committer Soonil Nagarkar <sooniln@google.com> 2021-09-02 17:49:11 +0000
commitf0bdc8722dbebca5d775d7bb75884f69c95e9810 (patch)
treefdc3442c73bb3b298aeb7f2c615fadd4498a8436
parenta2276a43e3871775a6a4be9e416023239f1267ba (diff)
Fix framework crash
Catch the correct exception on transport failure (CancelledException for PendingIntents). This leads to a crash in very rare race conditions (a location must be in the process of being delivered to the given PendingIntent at almost the exact moment that it is canceled, such that the canceled notification reaches the PendingIntent implementation before it reaches the location service, and the location is delivered after the notification reaches the PendingIntent implementation but before it reaches the location service. Bug: 198558226 Test: presubmits Change-Id: I20d30b534781c3aee805d80e66048a04e79a530c
-rw-r--r--services/core/java/com/android/server/location/provider/LocationProviderManager.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/location/provider/LocationProviderManager.java b/services/core/java/com/android/server/location/provider/LocationProviderManager.java
index 8955c288391f..62d8c320a13c 100644
--- a/services/core/java/com/android/server/location/provider/LocationProviderManager.java
+++ b/services/core/java/com/android/server/location/provider/LocationProviderManager.java
@@ -1078,7 +1078,7 @@ public class LocationProviderManager extends
}
private void onTransportFailure(Exception e) {
- if (e instanceof RemoteException) {
+ if (e instanceof PendingIntent.CanceledException) {
Log.w(TAG, mName + " provider registration " + getIdentity() + " removed", e);
synchronized (mLock) {
remove();