Loading aidl/com/android/media/permission/INativePermissionController.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.media.permission; import com.android.media.permission.PermissionEnum; import com.android.media.permission.UidPackageState; /** Loading @@ -33,4 +34,13 @@ interface INativePermissionController { * If the list is empty, the package no longer exists. */ void updatePackagesForUid(in UidPackageState newPackageState); /** * Populate or replace the list of uids which holds a particular permission. * Runtime permissions will need additional checks, and should not use the cache as-is. * Not virtual device aware. * Is is possible for updates to the permission state to be delayed during high traffic. * @param perm - Enum representing the permission for which holders are being supplied * @param uids - Uids (not app-ids) which hold the permission. Should be sorted */ void populatePermissionState(in PermissionEnum perm, in int[] uids); } aidl/com/android/media/permission/PermissionEnum.aidl 0 → 100644 +31 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.media.permission; /** * Enumerates permissions which are tracked/pushed by NativePermissionController * {@hide} */ enum PermissionEnum { MODIFY_AUDIO_ROUTING = 0, MODIFY_PHONE_STATE = 1, CALL_AUDIO_INTERCEPTION = 2, // This is a runtime + WIU permission, which means data delivery should be protected by AppOps // We query the controller only for early fails/hard errors RECORD_AUDIO = 3, ENUM_SIZE = 4, // Not for actual usage } media/audioserver/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ cc_binary { ], header_libs: [ "audiopolicyservicelocal_headers", "libaudiohal_headers", "libmedia_headers", "libmediametrics_headers", Loading media/audioserver/main_audioserver.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,7 @@ int main(int argc __unused, char **argv) ALOGW_IF(AudioSystem::setLocalAudioFlinger(af) != OK, "%s: AudioSystem already has an AudioFlinger instance!", __func__); const auto aps = sp<AudioPolicyService>::make(); af->initAudioPolicyLocal(aps); ALOGD("%s: AudioPolicy created", __func__); ALOGW_IF(AudioSystem::setLocalAudioPolicyService(aps) != OK, "%s: AudioSystem already has an AudioPolicyService instance!", __func__); Loading media/codec2/sfplugin/C2AidlNode.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -68,10 +68,15 @@ C2AidlNode::C2AidlNode(const std::shared_ptr<Codec2Client::Component> &comp) } ::ndk::ScopedAStatus C2AidlNode::submitBuffer( int32_t buffer, const ::aidl::android::hardware::HardwareBuffer& hBuffer, int32_t buffer, const std::optional<::aidl::android::hardware::HardwareBuffer>& hBuffer, int32_t flags, int64_t timestamp, const ::ndk::ScopedFileDescriptor& fence) { sp<GraphicBuffer> gBuf; AHardwareBuffer *ahwb = hBuffer.get(); AHardwareBuffer *ahwb = nullptr; if (hBuffer.has_value()) { ahwb = hBuffer.value().get(); } if (ahwb) { gBuf = AHardwareBuffer_to_GraphicBuffer(ahwb); } Loading Loading
aidl/com/android/media/permission/INativePermissionController.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.media.permission; import com.android.media.permission.PermissionEnum; import com.android.media.permission.UidPackageState; /** Loading @@ -33,4 +34,13 @@ interface INativePermissionController { * If the list is empty, the package no longer exists. */ void updatePackagesForUid(in UidPackageState newPackageState); /** * Populate or replace the list of uids which holds a particular permission. * Runtime permissions will need additional checks, and should not use the cache as-is. * Not virtual device aware. * Is is possible for updates to the permission state to be delayed during high traffic. * @param perm - Enum representing the permission for which holders are being supplied * @param uids - Uids (not app-ids) which hold the permission. Should be sorted */ void populatePermissionState(in PermissionEnum perm, in int[] uids); }
aidl/com/android/media/permission/PermissionEnum.aidl 0 → 100644 +31 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.media.permission; /** * Enumerates permissions which are tracked/pushed by NativePermissionController * {@hide} */ enum PermissionEnum { MODIFY_AUDIO_ROUTING = 0, MODIFY_PHONE_STATE = 1, CALL_AUDIO_INTERCEPTION = 2, // This is a runtime + WIU permission, which means data delivery should be protected by AppOps // We query the controller only for early fails/hard errors RECORD_AUDIO = 3, ENUM_SIZE = 4, // Not for actual usage }
media/audioserver/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ cc_binary { ], header_libs: [ "audiopolicyservicelocal_headers", "libaudiohal_headers", "libmedia_headers", "libmediametrics_headers", Loading
media/audioserver/main_audioserver.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,7 @@ int main(int argc __unused, char **argv) ALOGW_IF(AudioSystem::setLocalAudioFlinger(af) != OK, "%s: AudioSystem already has an AudioFlinger instance!", __func__); const auto aps = sp<AudioPolicyService>::make(); af->initAudioPolicyLocal(aps); ALOGD("%s: AudioPolicy created", __func__); ALOGW_IF(AudioSystem::setLocalAudioPolicyService(aps) != OK, "%s: AudioSystem already has an AudioPolicyService instance!", __func__); Loading
media/codec2/sfplugin/C2AidlNode.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -68,10 +68,15 @@ C2AidlNode::C2AidlNode(const std::shared_ptr<Codec2Client::Component> &comp) } ::ndk::ScopedAStatus C2AidlNode::submitBuffer( int32_t buffer, const ::aidl::android::hardware::HardwareBuffer& hBuffer, int32_t buffer, const std::optional<::aidl::android::hardware::HardwareBuffer>& hBuffer, int32_t flags, int64_t timestamp, const ::ndk::ScopedFileDescriptor& fence) { sp<GraphicBuffer> gBuf; AHardwareBuffer *ahwb = hBuffer.get(); AHardwareBuffer *ahwb = nullptr; if (hBuffer.has_value()) { ahwb = hBuffer.value().get(); } if (ahwb) { gBuf = AHardwareBuffer_to_GraphicBuffer(ahwb); } Loading