• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2016, 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 package com.android.car.radio.demo;
17 
18 import android.hardware.radio.RadioManager;
19 import com.android.car.radio.service.RadioRds;
20 import com.android.car.radio.service.RadioStation;
21 
22 import java.util.ArrayList;
23 import java.util.Arrays;
24 import java.util.List;
25 
26 /**
27  * Static lists of the mock radio stations for AM and FM bands.
28  */
29 public class DemoRadioStations {
30     private static final List<RadioStation> mFmStations = Arrays.asList(
31         new RadioStation(94900, 0, RadioManager.BAND_FM,
32                 new RadioRds("Wild 94.9", "Drake ft. Rihanna", "Too Good")),
33         new RadioStation(96500, 0, RadioManager.BAND_FM,
34                 new RadioRds("KOIT", "Celine Dion", "All By Myself")),
35         new RadioStation(97300, 0, RadioManager.BAND_FM,
36                 new RadioRds("Alice@97.3", "Drops of Jupiter", "Train")),
37         new RadioStation(99700, 0, RadioManager.BAND_FM,
38                 new RadioRds("99.7 Now!", "The Chainsmokers", "Closer")),
39         new RadioStation(101300, 0, RadioManager.BAND_FM,
40                 new RadioRds("101-3 KISS-FM", "Justin Timberlake", "Rock Your Body")),
41         new RadioStation(103700, 0, RadioManager.BAND_FM,
42                 new RadioRds("iHeart80s @ 103.7", "Michael Jackson", "Billie Jean")),
43         new RadioStation(106100, 0, RadioManager.BAND_FM,
44                 new RadioRds("106 KMEL", "Drake", "Marvins Room")));
45 
46     private static final List<RadioStation> mAmStations = Arrays.asList(
47         new RadioStation(530, 0, RadioManager.BAND_AM, null),
48         new RadioStation(610, 0, RadioManager.BAND_AM, null),
49         new RadioStation(730, 0, RadioManager.BAND_AM, null),
50         new RadioStation(801, 0, RadioManager.BAND_AM, null),
51         new RadioStation(930, 0, RadioManager.BAND_AM, null),
52         new RadioStation(1100, 0, RadioManager.BAND_AM, null),
53         new RadioStation(1480, 0, RadioManager.BAND_AM, null),
54         new RadioStation(1530, 0, RadioManager.BAND_AM, null));
55 
56     /**
57      * Returns a list of {@link RadioStation}s that represent all the FM channels.
58      */
getFmStations()59     public static List<RadioStation> getFmStations() {
60         // Create a new list so that the user of the list can modify the contents, but the main
61         // list will remain unchanged in this class.
62         return new ArrayList<>(mFmStations);
63     }
64 
65     /**
66      * Returns a list of {@link RadioStation}s that represent all the AM channels.
67      */
getAmStations()68     public static List<RadioStation> getAmStations() {
69         // Create a new list so that the user of the list can modify the contents, but the main
70         // list will remain unchanged in this class.
71         return new ArrayList<>(mAmStations);
72     }
73 }
74