1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package android.media; 17 18 /** 19 * Native accessible interface for AudioService. 20 * Note this interface has a mix of oneway and non-oneway methods. This is intentional for certain 21 * calls intended to come from audioserver. 22 * {@hide} 23 */ 24 interface IAudioManagerNative { 25 enum HardeningType { 26 // Restricted due to OP_CONTROL_AUDIO_PARTIAL 27 // This OP is more permissive than OP_CONTROL_AUDIO, which allows apps in a foreground state 28 // not associated with FGS to access audio 29 PARTIAL, 30 // Restricted due to OP_CONTROL_AUDIO 31 FULL, 32 } 33 34 /** 35 * audioserver is muting playback due to hardening. 36 * Calls which aren't from uid 1041 are dropped. 37 * @param uid - the uid whose playback is restricted 38 * @param type - the level of playback restriction which was hit (full or partial) 39 * @param bypassed - true if the client should be muted but was exempted (for example due to a 40 * certain audio usage to prevent regressions) 41 */ playbackHardeningEvent(in int uid, in HardeningType type, in boolean bypassed)42 oneway void playbackHardeningEvent(in int uid, in HardeningType type, in boolean bypassed); 43 44 /** 45 * Block until AudioService synchronizes pending permission state with audioserver. 46 */ permissionUpdateBarrier()47 void permissionUpdateBarrier(); 48 49 /** 50 * Update mute state event for port 51 * @param portId Port id to update 52 * @param event the mute event containing info about the mute 53 */ portMuteEvent(in int portId, in int event)54 oneway void portMuteEvent(in int portId, in int event); 55 } 56