1 /*
2  * Copyright (C) 2015 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 #pragma once
18 
19 #include <string>
20 #include <system/audio_policy.h>
21 
22 //////////////////////////////////////////////////////////////////////////////////////////////////
23 //      Definitions for audio policy criteria configuration file (audio_policy_criteria.conf)   //
24 //                                                                                              //
25 //      @TODO: scripted from audio.h & audio_policy,h                                           //
26 //////////////////////////////////////////////////////////////////////////////////////////////////
27 
28 static const char *const gAudioPolicyCriteriaConfFilePath =
29     "/system/etc/audio_policy_criteria.conf";
30 static const char *const gAudioPolicyCriteriaVendorConfFilePath =
31     "/vendor/etc/audio_policy_criteria.conf";
32 
33 /**
34  * PFW instances tags
35  */
36 static const std::string &gPolicyConfTag = "Policy";
37 static const std::string &gDefaultTag = "Default";
38 static const std::string &gTypeTag = "Type";
39 
40 /**
41  * PFW elements tags
42  */
43 static const std::string &gInclusiveCriterionTypeTag = "InclusiveCriterionType";
44 static const std::string &gExclusiveCriterionTypeTag = "ExclusiveCriterionType";
45 static const std::string &gCriterionTag = "Criterion";
46 
47 /**
48  * PFW known criterion tags
49  */
50 static const std::string &gInputDeviceCriterionTag = "AvailableInputDevices";
51 static const std::string &gOutputDeviceCriterionTag = "AvailableOutputDevices";
52 static const std::string &gPhoneStateCriterionTag = "TelephonyMode";
53 
54 /**
55  * Order MUST be align with defintiion of audio_policy_force_use_t within audio_policy.h
56  */
57 static const std::string gForceUseCriterionTag[AUDIO_POLICY_FORCE_USE_CNT] =
58 {
59     [AUDIO_POLICY_FORCE_FOR_COMMUNICATION] =        "ForceUseForCommunication",
60     [AUDIO_POLICY_FORCE_FOR_MEDIA] =                "ForceUseForMedia",
61     [AUDIO_POLICY_FORCE_FOR_RECORD] =               "ForceUseForRecord",
62     [AUDIO_POLICY_FORCE_FOR_DOCK] =                 "ForceUseForDock",
63     [AUDIO_POLICY_FORCE_FOR_SYSTEM] =               "ForceUseForSystem",
64     [AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO] =    "ForceUseForHdmiSystemAudio",
65     [AUDIO_POLICY_FORCE_FOR_ENCODED_SURROUND] =     "ForceUseForEncodedSurround"
66 };
67 
68 
69 
70 
71 
72 
73