1 /*
2  * Copyright (c) 2013 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 
18 package com.android.ims.internal;
19 
20 import com.android.ims.ImsConfigListener;
21 
22 /**
23  * Provides APIs to get/set the IMS service capability/parameters.
24  * The parameters can be configured by operator and/or user.
25  * We define 4 storage locations for the IMS config items:
26  * 1) Default config:For factory out device or device after factory data reset,
27  * the default config is used to build the initial state of the master config value.
28  * 2) Provisioned value: as the parameters provisioned by operator need to be preserved
29  * across FDR(factory data reset)/BOTA(over the air software upgrade), the operator
30  * provisioned items should be stored in memory location preserved across FDR/BOTA.
31  * 3) Master value: as the provisioned value can override the user setting,
32  * and the master config are used by IMS stack. They should be stored in the
33  * storage based on IMS vendor implementations.
34  * 4) User setting: For items can be changed by both user/operator, the user
35  * setting should take effect in some cases. So the user setting should be stored in
36  * database like setting.db.
37  *
38  * Priority consideration if both operator/user can config the same item:
39  * 1)  For feature config items, the master value is obtained from the provisioned value
40  * masks with the user setting. Specifically the provisioned values overrides
41  * the user setting if feature is provisioned off. Otherwise, user setting takes
42  * effect.
43  * 2) For non-feature config item: to be implemented based on cases.
44  * Special cases considered as below:
45  * 1) Factory out device, the master configuration is built from default config.
46  * 2) For Factory data reset/SW upgrade device, the master config is built by
47  * taking provisioned value overriding default config.
48  * {@hide}
49  */
50 interface IImsConfig {
51     /**
52      * Gets the value for ims service/capabilities parameters from the provisioned
53      * value storage. Synchronous blocking call.
54      *
55      * @param item, as defined in com.android.ims.ImsConfig#ConfigConstants.
56      * @return value in Integer format.
57      */
getProvisionedValue(int item)58     int getProvisionedValue(int item);
59 
60     /**
61      * Gets the value for ims service/capabilities parameters from the provisioned
62      * value storage. Synchronous blocking call.
63      *
64      * @param item, as defined in com.android.ims.ImsConfig#ConfigConstants.
65      * @return value in String format.
66      */
getProvisionedStringValue(int item)67     String getProvisionedStringValue(int item);
68 
69     /**
70      * Sets the value for IMS service/capabilities parameters by the operator device
71      * management entity. It sets the config item value in the provisioned storage
72      * from which the master value is derived. Synchronous blocking call.
73      *
74      * @param item, as defined in com.android.ims.ImsConfig#ConfigConstants.
75      * @param value in Integer format.
76      * @return as defined in com.android.ims.ImsConfig#OperationStatusConstants.
77      */
setProvisionedValue(int item, int value)78     int setProvisionedValue(int item, int value);
79 
80     /**
81      * Sets the value for IMS service/capabilities parameters by the operator device
82      * management entity. It sets the config item value in the provisioned storage
83      * from which the master value is derived.  Synchronous blocking call.
84      *
85      * @param item, as defined in com.android.ims.ImsConfig#ConfigConstants.
86      * @param value in String format.
87      * @return as defined in com.android.ims.ImsConfig#OperationStatusConstants.
88      */
setProvisionedStringValue(int item, String value)89     int setProvisionedStringValue(int item, String value);
90 
91     /**
92      * Gets the value of the specified IMS feature item for specified network type.
93      * This operation gets the feature config value from the master storage (i.e. final
94      * value). Asynchronous non-blocking call.
95      *
96      * @param feature. as defined in com.android.ims.ImsConfig#FeatureConstants.
97      * @param network. as defined in android.telephony.TelephonyManager#NETWORK_TYPE_XXX.
98      * @param listener. feature value returned asynchronously through listener.
99      * @return void
100      */
getFeatureValue(int feature, int network, ImsConfigListener listener)101     oneway void getFeatureValue(int feature, int network, ImsConfigListener listener);
102 
103     /**
104      * Sets the value for IMS feature item for specified network type.
105      * This operation stores the user setting in setting db from which master db
106      * is dervied.
107      *
108      * @param feature. as defined in com.android.ims.ImsConfig#FeatureConstants.
109      * @param network. as defined in android.telephony.TelephonyManager#NETWORK_TYPE_XXX.
110      * @param value. as defined in com.android.ims.ImsConfig#FeatureValueConstants.
111      * @param listener, provided if caller needs to be notified for set result.
112      * @return void
113      */
setFeatureValue(int feature, int network, int value, ImsConfigListener listener)114     oneway void setFeatureValue(int feature, int network, int value, ImsConfigListener listener);
115 
116     /**
117      * Gets the value for IMS volte provisioned.
118      * This should be the same as the operator provisioned value if applies.
119      *
120      * @return void
121      */
getVolteProvisioned()122     boolean getVolteProvisioned();
123 }
124