From fff052067c1926bd0e5ef5f852d4adba5333934d Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Tue, 15 Oct 2019 11:28:00 -0700 Subject: [PATCH] [DO NOT MERGE] Check CellInfoCallback Detail for Null In cases where the source of the CellInfo fails but does not generate a Throwable, the detail info will not be provided and should be null. Inside the user process, we need to check for null before dereferencing the detail object. Oops. :-( Bug: 142706765 Bug: 142421696 Test: manual Change-Id: I1307d1d7aacef0bbd33bfc73700ee774e12e64c1 --- telephony/java/android/telephony/TelephonyManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 8bd86259362b7..cf6cc3fa03291 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -5435,7 +5435,8 @@ public class TelephonyManager { public void onError(int errorCode, android.os.ParcelableException detail) { Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onError( - errorCode, detail.getCause()))); + errorCode, + detail == null ? null : detail.getCause()))); } }, getOpPackageName()); @@ -5475,7 +5476,8 @@ public class TelephonyManager { public void onError(int errorCode, android.os.ParcelableException detail) { Binder.withCleanCallingIdentity(() -> executor.execute(() -> callback.onError( - errorCode, detail.getCause()))); + errorCode, + detail == null ? null : detail.getCause()))); } }, getOpPackageName(), workSource); } catch (RemoteException ex) {