Expose allowAudioPlaybackCapture to PackageManagerNative

Audio playback has both c++ and java API.
The flag is needed in the audio policy service in c++ to know if the app
can be capture by other apps.

Bug: 119500128
Test: dumpsys media.audio_policy
Change-Id: I949b5e31039b024a34a9646a18586cff5f8807ab
Signed-off-by: Kevin Rocard <krocard@google.com>
This commit is contained in:
Kevin Rocard
2019-02-22 09:46:32 -08:00
parent f91d50b620
commit 1c70a60ea5

View File

@@ -23101,6 +23101,18 @@ public class PackageManagerService extends IPackageManager.Stub
}
return 0;
}
@Override
public boolean[] isAudioPlaybackCaptureAllowed(String[] packageNames)
throws RemoteException {
int callingUser = UserHandle.getUserId(Binder.getCallingUid());
boolean[] results = new boolean[packageNames.length];
for (int i = results.length - 1; i >= 0; --i) {
ApplicationInfo appInfo = getApplicationInfo(packageNames[i], 0, callingUser);
results[i] = appInfo == null ? false : appInfo.isAudioPlaybackCaptureAllowed();
}
return results;
}
}
private class PackageManagerInternalImpl extends PackageManagerInternal {