summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorScott Mertz <scott@cyngn.com>2016-07-06 10:18:52 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-07-08 12:01:48 -0700
commit940b28bc37f819c62386e393614354f55069e8f6 (patch)
tree84c3164796dbbdbf050ec36c377cd0588ca30d55 /services/audioflinger
parent1e7c9d2c408b17fa14f897cfe8d1ae06fe944637 (diff)
downloadframeworks_av-940b28bc37f819c62386e393614354f55069e8f6.zip
frameworks_av-940b28bc37f819c62386e393614354f55069e8f6.tar.gz
frameworks_av-940b28bc37f819c62386e393614354f55069e8f6.tar.bz2
Enforce permission for accessing fm tuner
Change-Id: I13f3ba8fc9caaeee21597a2405a8c3629e985502
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/ServiceUtilities.cpp8
-rw-r--r--services/audioflinger/ServiceUtilities.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/services/audioflinger/ServiceUtilities.cpp b/services/audioflinger/ServiceUtilities.cpp
index 2e68dad..031ff05 100644
--- a/services/audioflinger/ServiceUtilities.cpp
+++ b/services/audioflinger/ServiceUtilities.cpp
@@ -106,6 +106,14 @@ bool captureAudioOutputAllowed() {
return ok;
}
+bool accessFmRadioAllowed() {
+ static const String16 sAccessFmRadio("android.permission.ACCESS_FM_RADIO");
+ // IMPORTANT: Use PermissionCache - not a runtime permission and may not change.
+ bool ok = PermissionCache::checkCallingPermission(sAccessFmRadio);
+ if (!ok) ALOGE("Request requires android.permission.ACCESS_FM_RADIO");
+ return ok;
+}
+
bool captureHotwordAllowed() {
static const String16 sCaptureHotwordAllowed("android.permission.CAPTURE_AUDIO_HOTWORD");
// IMPORTANT: Use PermissionCache - not a runtime permission and may not change.
diff --git a/services/audioflinger/ServiceUtilities.h b/services/audioflinger/ServiceUtilities.h
index fba6dce..dffb114 100644
--- a/services/audioflinger/ServiceUtilities.h
+++ b/services/audioflinger/ServiceUtilities.h
@@ -21,6 +21,7 @@ namespace android {
extern pid_t getpid_cached;
bool recordingAllowed(const String16& opPackageName);
+bool accessFmRadioAllowed();
bool captureAudioOutputAllowed();
bool captureHotwordAllowed();
bool settingsAllowed();