blob: 8ead410111a01e1c0f259e8663d304baf83b8347 [file] [log] [blame]
Glenn Kasten44deb052012-02-05 18:09:08 -08001/*
2 * Copyright (C) 2012 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
17#include <unistd.h>
18
Svet Ganov5b81f552018-03-02 09:21:30 -080019#include <binder/PermissionController.h>
20
Glenn Kasten44deb052012-02-05 18:09:08 -080021namespace android {
22
Andy Hungab7ef302018-05-15 19:35:29 -070023// Audio permission utilities
24
Glenn Kasten949a9262013-04-16 12:35:20 -070025extern pid_t getpid_cached;
Marco Nelissendcb346b2015-09-09 10:47:29 -070026bool isTrustedCallingUid(uid_t uid);
27bool recordingAllowed(const String16& opPackageName, pid_t pid, uid_t uid);
Svet Ganov5b81f552018-03-02 09:21:30 -080028bool startRecording(const String16& opPackageName, pid_t pid, uid_t uid);
29void finishRecording(const String16& opPackageName, uid_t uid);
Eric Laurentb2379ba2016-05-23 17:42:12 -070030bool captureAudioOutputAllowed(pid_t pid, uid_t uid);
Eric Laurent7504b9e2017-08-15 18:17:26 -070031bool captureHotwordAllowed(pid_t pid, uid_t uid);
Glenn Kasten44deb052012-02-05 18:09:08 -080032bool settingsAllowed();
Eric Laurent5284ed52014-05-29 14:37:38 -070033bool modifyAudioRoutingAllowed();
Glenn Kasten44deb052012-02-05 18:09:08 -080034bool dumpAllowed();
Nadav Bar766fb022018-01-07 12:18:03 +020035bool modifyPhoneStateAllowed(pid_t pid, uid_t uid);
Glenn Kasten44deb052012-02-05 18:09:08 -080036}