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

Commit 3626fb20 authored by Yegor Malyshev's avatar Yegor Malyshev
Browse files

Make ApplicationInfo.isAudioPlaybackCaptureAllowed() public

This method is used by apps to determine if they are allowed to capture audio playback. The AudioPlaybackConfiguration.getAllowedCapturePolicy() only provides runtime information so this is essential to avoid false-positive results.

(cherry picked from https://android-review.googlesource.com/q/commit:f08f5bbe0085fc5b14f12c7f6855f95a053698c9 due to conflicts, Merge-ID in aosp to prevent merging to internal repo)

Bug: 362425551
Flag: android.content.pm.audio_playback_capture_allowance
Test: cts/tests/tests/content/src/android/content/pm/cts/ApplicationInfoTest
Change-Id: Iee165d21bc198b1afdce6145b124a02604684a1b
parent 71ecd94b
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -12289,6 +12289,7 @@ package android.content.pm {
    method public int getMemtagMode();
    method public int getMemtagMode();
    method public int getNativeHeapZeroInitialized();
    method public int getNativeHeapZeroInitialized();
    method public int getRequestRawExternalStorageAccess();
    method public int getRequestRawExternalStorageAccess();
    method @FlaggedApi("android.content.pm.audio_playback_capture_allowance") public boolean isAudioPlaybackCaptureAllowed();
    method public boolean isProfileable();
    method public boolean isProfileable();
    method public boolean isProfileableByShell();
    method public boolean isProfileableByShell();
    method public boolean isResourceOverlay();
    method public boolean isResourceOverlay();
+1 −2
Original line number Original line Diff line number Diff line
@@ -2334,9 +2334,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
     * Whether an app allows its playback audio to be captured by other apps.
     * Whether an app allows its playback audio to be captured by other apps.
     *
     *
     * @return {@code true} if the app indicates that its audio can be captured by other apps.
     * @return {@code true} if the app indicates that its audio can be captured by other apps.
     *
     * @hide
     */
     */
    @FlaggedApi(Flags.FLAG_AUDIO_PLAYBACK_CAPTURE_ALLOWANCE)
    public boolean isAudioPlaybackCaptureAllowed() {
    public boolean isAudioPlaybackCaptureAllowed() {
        return (privateFlags & PRIVATE_FLAG_ALLOW_AUDIO_PLAYBACK_CAPTURE) != 0;
        return (privateFlags & PRIVATE_FLAG_ALLOW_AUDIO_PLAYBACK_CAPTURE) != 0;
    }
    }
+9 −0
Original line number Original line Diff line number Diff line
@@ -287,6 +287,15 @@ flag {
    bug: "340879905"
    bug: "340879905"
}
}


flag {
    name: "audio_playback_capture_allowance"
    is_exported: true
    namespace: "package_manager_service"
    description: "Feature flag to enable the feature to retrieve info about audio playback capture allowance at manifest level."
    bug: "362425551"
    is_fixed_read_only: true
}

flag {
flag {
    name: "get_packages_from_launcher_apps"
    name: "get_packages_from_launcher_apps"
    namespace: "package_manager_service"
    namespace: "package_manager_service"