Fix null handling of getAllCellInfo
Robert Greenwalt [Wed, 19 Aug 2015 19:28:56 +0000 (12:28 -0700)]
ServiceStateTracker.getAllCellInfo may return null, but
PhoneBase.privatizeCellInfoList may dereference that.  Check
for null rather than crash the phone.

bug:23201508
Change-Id: I26fcfc015fa1a8d1ec13e34f3369d1848954c44e

src/java/com/android/internal/telephony/PhoneBase.java

index 570f863..4037392 100644 (file)
@@ -1314,6 +1314,7 @@ public abstract class PhoneBase extends Handler implements Phone {
      * @return the original list with CDMA lat/long cleared if necessary
      */
     private List<CellInfo> privatizeCellInfoList(List<CellInfo> cellInfoList) {
+        if (cellInfoList == null) return null;
         int mode = Settings.Secure.getInt(getContext().getContentResolver(),
                 Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
         if (mode == Settings.Secure.LOCATION_MODE_OFF) {