From b09250e794024ee54c666bab1c2e3325165a9467 Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Tue, 15 Oct 2019 11:28:00 -0700 Subject: [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 Merged-In: I1307d1d7aacef0bbd33bfc73700ee774e12e64c1 Change-Id: I1307d1d7aacef0bbd33bfc73700ee774e12e64c1 (cherry picked from commit fff052067c1926bd0e5ef5f852d4adba5333934d) --- 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 b37acf3143cb..8c2145ab1551 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -5353,7 +5353,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()); @@ -5393,7 +5394,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) { -- cgit v1.2.3-59-g8ed1b