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

Commit b23f0c30 authored by Evan Severson's avatar Evan Severson
Browse files

Catch Illegal argument exception

This is probably a sign that something is calling startOp() on an app
that isn't even running, but the service shouldn't take out the system
server when this happens.

Test: Presubmit tests
Fixes: 192557017
Change-Id: I7aae3f37d08303fb17aa8d0af3c9a56bd25b36af
parent 75f7a289
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -440,7 +440,14 @@ public final class SensorPrivacyService extends SystemService {
                inputMethodPackageName = ComponentName.unflattenFromString(
                inputMethodPackageName = ComponentName.unflattenFromString(
                        inputMethodComponent).getPackageName();
                        inputMethodComponent).getPackageName();
            }
            }
            int capability = mActivityManagerInternal.getUidCapability(uid);

            int capability;
            try {
                capability = mActivityManagerInternal.getUidCapability(uid);
            } catch (IllegalArgumentException e) {
                Log.w(TAG, e);
                return;
            }


            if (sensor == MICROPHONE) {
            if (sensor == MICROPHONE) {
                VoiceInteractionManagerInternal voiceInteractionManagerInternal =
                VoiceInteractionManagerInternal voiceInteractionManagerInternal =