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
This commit is contained in:
Evan Severson
2021-07-01 08:51:09 -07:00
parent 75f7a2894b
commit b23f0c30c8

View File

@@ -440,7 +440,14 @@ public final class SensorPrivacyService extends SystemService {
inputMethodPackageName = ComponentName.unflattenFromString(
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) {
VoiceInteractionManagerInternal voiceInteractionManagerInternal =