1 /* 2 * Copyright (C) 2018 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 <system/audio.h> 20 21 namespace android { 22 /** 23 * @brief AudioProductStrategies hard coded array of strategies to fill new engine API contract. 24 */ 25 const engineConfig::ProductStrategies gOrderedStrategies = { 26 {"STRATEGY_PHONE", 27 { 28 {"phone", AUDIO_STREAM_VOICE_CALL, "AUDIO_STREAM_VOICE_CALL", 29 {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_VOICE_COMMUNICATION, AUDIO_SOURCE_DEFAULT, 0, 30 ""}}, 31 }, 32 {"sco", AUDIO_STREAM_BLUETOOTH_SCO, "AUDIO_STREAM_BLUETOOTH_SCO", 33 {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_UNKNOWN, AUDIO_SOURCE_DEFAULT, AUDIO_FLAG_SCO, 34 ""}}, 35 } 36 }, 37 }, 38 {"STRATEGY_SONIFICATION", 39 { 40 {"ring", AUDIO_STREAM_RING, "AUDIO_STREAM_RING", 41 {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE, 42 AUDIO_SOURCE_DEFAULT, 0, ""}} 43 }, 44 {"alarm", AUDIO_STREAM_ALARM, "AUDIO_STREAM_ALARM", 45 {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_ALARM, AUDIO_SOURCE_DEFAULT, 0, ""}}, 46 } 47 }, 48 }, 49 {"STRATEGY_ENFORCED_AUDIBLE", 50 { 51 {"", AUDIO_STREAM_ENFORCED_AUDIBLE, "AUDIO_STREAM_ENFORCED_AUDIBLE", 52 {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_UNKNOWN, AUDIO_SOURCE_DEFAULT, 53 AUDIO_FLAG_AUDIBILITY_ENFORCED, ""}} 54 } 55 }, 56 }, 57 {"STRATEGY_ACCESSIBILITY", 58 { 59 {"", AUDIO_STREAM_ACCESSIBILITY, "AUDIO_STREAM_ACCESSIBILITY", 60 {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY, 61 AUDIO_SOURCE_DEFAULT, 0, ""}} 62 } 63 }, 64 }, 65 {"STRATEGY_SONIFICATION_RESPECTFUL", 66 { 67 {"", AUDIO_STREAM_NOTIFICATION, "AUDIO_STREAM_NOTIFICATION", 68 { 69 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_NOTIFICATION, AUDIO_SOURCE_DEFAULT, 0, ""}, 70 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_NOTIFICATION_COMMUNICATION_REQUEST, 71 AUDIO_SOURCE_DEFAULT, 0, ""}, 72 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_NOTIFICATION_COMMUNICATION_INSTANT, 73 AUDIO_SOURCE_DEFAULT, 0, ""}, 74 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_NOTIFICATION_COMMUNICATION_DELAYED, 75 AUDIO_SOURCE_DEFAULT, 0, ""}, 76 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_NOTIFICATION_EVENT, 77 AUDIO_SOURCE_DEFAULT, 0, ""} 78 } 79 } 80 }, 81 }, 82 {"STRATEGY_MEDIA", 83 { 84 {"music", AUDIO_STREAM_MUSIC, "AUDIO_STREAM_MUSIC", 85 { 86 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_MEDIA, AUDIO_SOURCE_DEFAULT, 0, ""}, 87 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_GAME, AUDIO_SOURCE_DEFAULT, 0, ""}, 88 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_ASSISTANT, AUDIO_SOURCE_DEFAULT, 0, ""}, 89 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE, 90 AUDIO_SOURCE_DEFAULT, 0, ""}, 91 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_UNKNOWN, AUDIO_SOURCE_DEFAULT, 0, ""} 92 }, 93 }, 94 {"system", AUDIO_STREAM_SYSTEM, "AUDIO_STREAM_SYSTEM", 95 {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_ASSISTANCE_SONIFICATION, 96 AUDIO_SOURCE_DEFAULT, 0, ""}} 97 } 98 }, 99 }, 100 {"STRATEGY_DTMF", 101 { 102 {"", AUDIO_STREAM_DTMF, "AUDIO_STREAM_DTMF", 103 { 104 {AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_VOICE_COMMUNICATION_SIGNALLING, 105 AUDIO_SOURCE_DEFAULT, 0, ""} 106 } 107 } 108 }, 109 }, 110 {"STRATEGY_TRANSMITTED_THROUGH_SPEAKER", 111 { 112 {"", AUDIO_STREAM_TTS, "AUDIO_STREAM_TTS", 113 {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_UNKNOWN, AUDIO_SOURCE_DEFAULT, 114 AUDIO_FLAG_BEACON, ""}} 115 } 116 }, 117 }, 118 {"STRATEGY_REROUTING", 119 { 120 {"", AUDIO_STREAM_REROUTING, "AUDIO_STREAM_REROUTING", 121 {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_UNKNOWN, AUDIO_SOURCE_DEFAULT, 0, ""}} 122 } 123 }, 124 }, 125 {"STRATEGY_PATCH", 126 { 127 {"", AUDIO_STREAM_PATCH, "AUDIO_STREAM_PATCH", 128 {{AUDIO_CONTENT_TYPE_UNKNOWN, AUDIO_USAGE_UNKNOWN, AUDIO_SOURCE_DEFAULT, 0, ""}} 129 } 130 }, 131 } 132 }; 133 134 const engineConfig::Config gDefaultEngineConfig = { 135 1.0, 136 gOrderedStrategies, 137 {}, 138 {}, 139 {} 140 }; 141 } // namespace android 142