summaryrefslogtreecommitdiffstats
path: root/src/com/android/carrierconfig/DefaultCarrierConfigService.java
blob: 2182a1b0670af04cde2e93c5634fed4e79fa8d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
package com.android.carrierconfig;

import android.os.Bundle;
import android.service.carrier.CarrierConfigService;
import android.service.carrier.CarrierIdentifier;
import android.telephony.CarrierConfigManager;
import android.util.Log;

import java.util.HashMap;

public class DefaultCarrierConfigService extends CarrierConfigService {

    private static final String TAG = "DefaultCarrierConfigService";

    private static final HashMap<String, Bundle> sCarrierOverlays;

    static {
        sCarrierOverlays = new HashMap<>();

        Bundle config00101 = new Bundle();
        Bundle config001001 = new Bundle();
        Bundle config001010 = new Bundle();
        Bundle config246081 = new Bundle();
        Bundle config310004 = new Bundle();
        Bundle config310028 = new Bundle();
        Bundle config310120 = new Bundle();
        Bundle config310160 = new Bundle();
        Bundle config310200 = new Bundle();
        Bundle config310210 = new Bundle();
        Bundle config310220 = new Bundle();
        Bundle config310230 = new Bundle();
        Bundle config310240 = new Bundle();
        Bundle config310250 = new Bundle();
        Bundle config310260 = new Bundle();
        Bundle config310270 = new Bundle();
        Bundle config310300 = new Bundle();
        Bundle config310310 = new Bundle();
        Bundle config310410 = new Bundle();
        Bundle config310490 = new Bundle();
        Bundle config310530 = new Bundle();
        Bundle config310580 = new Bundle();
        Bundle config310590 = new Bundle();
        Bundle config310640 = new Bundle();
        Bundle config310660 = new Bundle();
        Bundle config310800 = new Bundle();
        Bundle config311390 = new Bundle();
        Bundle config311480 = new Bundle();

        config00101.putBoolean(CarrierConfigManager.BOOL_SHOW_APN_SETTING_CDMA, true);
        config001001.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config001010.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);

        config246081.putBoolean(CarrierConfigManager.BOOL_SHOW_APN_SETTING_CDMA, true);

        config310004.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 6);

        config310028.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310028.putBoolean(CarrierConfigManager.BOOL_SHOW_APN_SETTING_CDMA, true);
        config310028.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 6);

        config310120.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 6);

        config310160.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310160.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310200.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310200.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310210.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310210.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310220.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310220.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310230.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310230.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310240.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310240.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310250.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310250.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310260.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310260.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);
        config310260.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 3);

        config310270.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310270.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310300.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310300.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310310.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310310.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310410.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 3);

        config310490.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310490.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310530.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310530.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310580.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310580.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310590.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310590.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310640.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310640.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310660.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310660.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config310800.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config310800.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_TTY_SUPPORTED, false);

        config311390.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config311390.putBoolean(CarrierConfigManager.BOOL_SHOW_APN_SETTING_CDMA, true);
        config311390.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 6);

        config311480.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_AVAILABLE, true);
        config311480.putBoolean(CarrierConfigManager.BOOL_CARRIER_VOLTE_PROVISIONED, true);
        config311480.putInt(CarrierConfigManager.INT_VOLTE_REPLACEMENT_RAT, 6);

        sCarrierOverlays.put("00101", config00101);
        sCarrierOverlays.put("001001", config001001);
        sCarrierOverlays.put("001010", config001010);
        sCarrierOverlays.put("246081", config246081);
        sCarrierOverlays.put("310004", config310004);
        sCarrierOverlays.put("310028", config310028);
        sCarrierOverlays.put("310120", config310120);
        sCarrierOverlays.put("310160", config310160);
        sCarrierOverlays.put("310200", config310200);
        sCarrierOverlays.put("310210", config310210);
        sCarrierOverlays.put("310220", config310220);
        sCarrierOverlays.put("310230", config310230);
        sCarrierOverlays.put("310240", config310240);
        sCarrierOverlays.put("310250", config310250);
        sCarrierOverlays.put("310260", config310260);
        sCarrierOverlays.put("310270", config310270);
        sCarrierOverlays.put("310300", config310300);
        sCarrierOverlays.put("310310", config310310);
        sCarrierOverlays.put("310410", config310410);
        sCarrierOverlays.put("310490", config310490);
        sCarrierOverlays.put("310530", config310530);
        sCarrierOverlays.put("310580", config310580);
        sCarrierOverlays.put("310590", config310590);
        sCarrierOverlays.put("310640", config310640);
        sCarrierOverlays.put("310660", config310660);
        sCarrierOverlays.put("310800", config310800);
        sCarrierOverlays.put("311390", config311390);
        sCarrierOverlays.put("311480", config311480);
    }


    public DefaultCarrierConfigService() {
        Log.d(TAG, "Service created");
    }

    @Override
    public Bundle onLoadConfig(CarrierIdentifier id) {
        Log.d(TAG, "Config being fetched");
        // Return null for unknown networks - they should use the defaults.
        return sCarrierOverlays.get(id.getMcc() + id.getMnc());
    }
}