Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c08d2d98 authored by Evan Tyra's avatar Evan Tyra
Browse files

Catch NPE in getServiceStateForSubscriber

ITelephony can enter a bad state with an incorrect SubId and throw an
NPE as shown in the attached bug. This is not an expected error, so a
bugreport will be triggered on userdebug builds on catch.

Test: Local
Bug: 134067547
Change-Id: Ib8f3b69eb3870c3567578aadaee6cf2693526fbd
parent 4410d235
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
import java.util.regex.Matcher;
@@ -9239,6 +9240,10 @@ public class TelephonyManager {
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#getServiceStateForSubscriber", e);
        } catch (NullPointerException e) {
            AnomalyReporter.reportAnomaly(
                    UUID.fromString("a3ab0b9d-f2aa-4baf-911d-7096c0d4645a"),
                    "getServiceStateForSubscriber " + subId + " NPE");
        }
        return null;
    }