Merge "Provide extra seinfo for SandboxedDetectionService"
This commit is contained in:
@@ -175,6 +175,8 @@ import android.os.TransactionTooLargeException;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
import android.service.voice.HotwordDetectionService;
|
||||
import android.service.voice.VisualQueryDetectionService;
|
||||
import android.stats.devicepolicy.DevicePolicyEnums;
|
||||
import android.text.TextUtils;
|
||||
import android.util.ArrayMap;
|
||||
@@ -3808,6 +3810,17 @@ public final class ActiveServices {
|
||||
inSharedIsolatedProcess);
|
||||
}
|
||||
|
||||
// TODO(b/265746493): Special case for HotwordDetectionService and
|
||||
// VisualQueryDetectionService. Need a cleaner way to append this seInfo.
|
||||
private String generateAdditionalSeInfoFromService(Intent service) {
|
||||
if (service != null && service.getAction() != null
|
||||
&& (service.getAction().equals(HotwordDetectionService.SERVICE_INTERFACE)
|
||||
|| service.getAction().equals(VisualQueryDetectionService.SERVICE_INTERFACE))) {
|
||||
return ":isolatedComputeApp";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private ServiceLookupResult retrieveServiceLocked(Intent service,
|
||||
String instanceName, boolean isSdkSandboxService, int sdkSandboxClientAppUid,
|
||||
String sdkSandboxClientAppPackage, String resolvedType,
|
||||
@@ -3925,6 +3938,7 @@ public final class ActiveServices {
|
||||
r.mRecentCallingPackage = callingPackage;
|
||||
r.mRecentCallingUid = callingUid;
|
||||
}
|
||||
r.appInfo.seInfo += generateAdditionalSeInfoFromService(service);
|
||||
return new ServiceLookupResult(r, resolution.getAlias());
|
||||
}
|
||||
|
||||
@@ -4150,6 +4164,7 @@ public final class ActiveServices {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
r.appInfo.seInfo += generateAdditionalSeInfoFromService(service);
|
||||
return new ServiceLookupResult(r, resolution.getAlias());
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user