From 940b28bc37f819c62386e393614354f55069e8f6 Mon Sep 17 00:00:00 2001 From: Scott Mertz Date: Wed, 6 Jul 2016 10:18:52 -0700 Subject: Enforce permission for accessing fm tuner Change-Id: I13f3ba8fc9caaeee21597a2405a8c3629e985502 --- services/audioflinger/ServiceUtilities.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'services/audioflinger/ServiceUtilities.cpp') 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. -- cgit v1.1