Don't kill apps that are multi-user aware...

... when looking for background user apps that hold RECORD_AUDIO
permission.

On switching users, we kill any apps that might potentially be
recording audio. But we don't want to kill critical apps that need
to stay running because of multi-user aware services.

Bug: 22564430
Change-Id: I6d9a684d4e044cc3018f0f8181a44aa143a3baeb
This commit is contained in:
Amith Yamasani
2015-07-21 11:46:14 -07:00
parent 1fcb6d3ae2
commit c1cbaaba6c

View File

@@ -5126,6 +5126,11 @@ public class AudioService extends IAudioService.Stub {
if (UserHandle.getAppId(pkg.applicationInfo.uid) < FIRST_APPLICATION_UID) {
continue;
}
// Skip packages that have permission to interact across users
if (pm.checkPermission(Manifest.permission.INTERACT_ACROSS_USERS, pkg.packageName)
== PackageManager.PERMISSION_GRANTED) {
continue;
}
if (homeActivityName != null
&& pkg.packageName.equals(homeActivityName.getPackageName())
&& pkg.applicationInfo.isSystemApp()) {