|
@@ -9,6 +9,7 @@ import { hideDialog, BottomSheet } from '../../../base/dialog';
|
9
|
9
|
import { translate } from '../../../base/i18n';
|
10
|
10
|
import {
|
11
|
11
|
Icon,
|
|
12
|
+ IconCar,
|
12
|
13
|
IconDeviceBluetooth,
|
13
|
14
|
IconDeviceEarpiece,
|
14
|
15
|
IconDeviceHeadphone,
|
|
@@ -125,6 +126,11 @@ const deviceInfoMap = {
|
125
|
126
|
text: 'audioDevices.bluetooth',
|
126
|
127
|
type: 'BLUETOOTH'
|
127
|
128
|
},
|
|
129
|
+ CAR: {
|
|
130
|
+ icon: IconCar,
|
|
131
|
+ text: 'audioDevices.car',
|
|
132
|
+ type: 'CAR'
|
|
133
|
+ },
|
128
|
134
|
EARPIECE: {
|
129
|
135
|
icon: IconDeviceEarpiece,
|
130
|
136
|
text: 'audioDevices.phone',
|
|
@@ -166,7 +172,7 @@ class AudioRoutePickerDialog extends Component<Props, State> {
|
166
|
172
|
* @inheritdoc
|
167
|
173
|
*/
|
168
|
174
|
static getDerivedStateFromProps(props: Props) {
|
169
|
|
- const { _devices: devices } = props;
|
|
175
|
+ const { _devices: devices, t } = props;
|
170
|
176
|
|
171
|
177
|
if (!devices) {
|
172
|
178
|
return null;
|
|
@@ -183,13 +189,18 @@ class AudioRoutePickerDialog extends Component<Props, State> {
|
183
|
189
|
continue;
|
184
|
190
|
}
|
185
|
191
|
|
186
|
|
- const text = device.type === 'BLUETOOTH' && device.name ? device.name : infoMap.text;
|
|
192
|
+ let text = t(infoMap.text);
|
|
193
|
+
|
|
194
|
+ // iOS provides descriptive names for these, use it.
|
|
195
|
+ if ((device.type === 'BLUETOOTH' || device.type === 'CAR') && device.name) {
|
|
196
|
+ text = device.name;
|
|
197
|
+ }
|
187
|
198
|
|
188
|
199
|
if (infoMap) {
|
189
|
200
|
const info = {
|
190
|
201
|
...infoMap,
|
191
|
202
|
selected: Boolean(device.selected),
|
192
|
|
- text: props.t(text),
|
|
203
|
+ text,
|
193
|
204
|
uid: device.uid
|
194
|
205
|
};
|
195
|
206
|
|