[DS] DSDS support for Settings

+ Rebase and modify as APIs rename.
+ Fix bugs on set sub's name as title.
+ Enabled Sim Settings.

Change-Id: Ic731c7882be95b86b6b8dcdd3f208a6125681f3e
This commit is contained in:
PauloftheWest
2014-10-03 11:07:14 -07:00
parent dbd052ed5e
commit 50e6ecacf9
11 changed files with 349 additions and 395 deletions

View File

@@ -33,6 +33,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/sim_dialog_margin_top"
android:paddingStart="@dimen/sim_label_padding"
android:text="@string/sim_editor_name"
style="?android:attr/textAppearanceMedium" />
@@ -40,6 +41,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginStart="@dimen/sim_content_padding"
android:paddingBottom="@dimen/sim_dialog_margin_bottom"
android:hint="@string/wifi_ssid_hint"
android:inputType="textNoSuggestions"
@@ -56,12 +58,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/sim_dialog_margin_top"
android:paddingStart="@dimen/sim_label_padding"
android:text="@string/sim_editor_carrier" />
<TextView android:id="@+id/carrier"
android:textColor="@android:color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/sim_label_padding"
android:paddingBottom="@dimen/sim_dialog_margin_bottom"
android:singleLine="true"
style="?android:attr/textAppearanceMedium" />
@@ -77,12 +81,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/sim_dialog_margin_top"
android:paddingStart="@dimen/sim_label_padding"
android:text="@string/sim_editor_number" />
<TextView android:id="@+id/number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/sim_dialog_margin_bottom"
android:paddingStart="@dimen/sim_label_padding"
android:singleLine="true"
android:textColor="@android:color/black"
style="?android:attr/textAppearanceMedium" />
@@ -97,6 +103,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/sim_label_padding"
android:layout_marginTop="@dimen/sim_dialog_margin_top"
android:text="@string/sim_editor_num_format" />
@@ -105,6 +112,7 @@
android:layout_height="wrap_content"
android:entries="@array/sim_card_data_range"
android:paddingBottom="@dimen/sim_dialog_margin_bottom"
android:paddingStart="@dimen/sim_content_padding"
android:prompt="@string/sim_editor_num_format" />
</LinearLayout>

View File

@@ -1265,4 +1265,22 @@
<item>Cached (activity client)</item>
<item>Cached (empty)</item>
</string-array>
<!-- Multi-SIM titles for captioning color preference. -->
<string-array name="sim_info_picker_color_titles" translatable="false" >
<item>@string/color_blue</item>
<item>@string/color_green</item>
<item>@string/color_purple</item>
<item>@string/color_red</item>
<item>@string/color_orange</item>
</string-array>
<!-- Multi-SIM colors. -->
<integer-array name="sim_info_picker_color_values" translatable="false" >
<item>@color/blue_500</item>
<item>@color/green_500</item>
<item>@color/purple_500</item>
<item>@color/red_500</item>
<item>@color/orange_500</item>
</integer-array>
</resources>

View File

@@ -75,4 +75,11 @@
<color name="wifi_divider">#ffe0e0e0</color>
<!-- Multi-SIM colors -->
<color name="blue_500">#5677fc</color>
<color name="green_500">#259b24</color>
<color name="purple_500">#9c27b0</color>
<color name="red_500">#e51c23</color>
<color name="orange_500">#ff9800</color>
</resources>

View File

@@ -204,6 +204,8 @@
<dimen name="sim_dialog_margin_bottom">16dip</dimen>
<!-- SIM Dialog padding -->
<dimen name="sim_dialog_padding">8dip</dimen>
<dimen name="sim_label_padding">16dip</dimen>
<dimen name="sim_content_padding">12dip</dimen>
<!-- Sim Card Name length -->
<integer name="sim_name_length">32</integer>

View File

@@ -5909,4 +5909,9 @@
<!-- [CHAR LIMIT=70] Don't rotate when screen is turned option -->
<string name="display_auto_rotate_stay_in_current">Stay in current orientation</string>
<!-- Title and summary for SIM Status -->
<!-- Title for IMEI preference [CHAR LIMIT=30] -->
<string name="imei_information_title">IMEI information</string>
<!-- Description for IMEI preference [CHAR LIMIT=40] -->
<string name="imei_information_summary">IMEI relative information</string>
</resources>

View File

@@ -27,79 +27,20 @@
android:title="@string/battery_level_title"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="operator_name"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_operator"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="signal_strength"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_signal_strength"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="network_type"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_network_type"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="latest_area_info"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_latest_area_info"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="service_state"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_service_state"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="roaming_state"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_roaming"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="data_state"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_data_state"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="number"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_number"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<!-- This menu item is only for CDMA phone -->
<Preference android:key="min_number"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_min_number"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<!-- This menu item is only for CDMA phone -->
<Preference android:key="prl_version"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_prl_version"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<!-- This menu item is only for CDMA phone -->
<Preference android:key="meid_number"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_meid_number"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="imei"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_imei"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="imei_sv"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_imei_sv"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<Preference android:key="icc_id"
style="?android:attr/preferenceInformationStyle"
android:title="@string/status_icc_id"
android:summary="@string/device_info_not_available"
android:persistent="false" />
<PreferenceScreen android:key="sim_status"
android:title="@string/sim_status_title"
android:summary="@string/sim_status_summary"
android:persistent="false">
<intent android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.deviceinfo.SimStatus" />
</PreferenceScreen>
<PreferenceScreen android:key="imei_info"
android:title="@string/imei_information_title"
android:summary="@string/imei_information_summary"
android:persistent="false">
<intent android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.deviceinfo.ImeiInformation" />
</PreferenceScreen>
<Preference android:key="wifi_ip_address"
style="?android:attr/preferenceInformationStyle"
android:title="@string/wifi_advanced_ip_address_title"

View File

@@ -88,6 +88,8 @@ import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.preference.Preference;
import android.telephony.SubInfoRecord;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.text.format.DateUtils;
@@ -135,6 +137,7 @@ import com.android.settings.net.UidDetailProvider;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settings.search.SearchIndexableRaw;
import com.android.settings.sim.SimSettings;
import com.android.settings.widget.ChartDataUsageView;
import com.android.settings.widget.ChartDataUsageView.DataUsageChartListener;
import com.google.android.collect.Lists;
@@ -143,8 +146,11 @@ import libcore.util.Objects;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
/**
* Panel showing data usage history across various networks, including options
@@ -261,6 +267,9 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
private MenuItem mMenuSimCards;
private MenuItem mMenuCellularNetworks;
private List<SubInfoRecord> mSubInfoList;
private Map<Long,String> mMobileTagMap;
/** Flag used to ignore listeners during binding. */
private boolean mBinding;
@@ -283,6 +292,9 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
mPolicyEditor = new NetworkPolicyEditor(mPolicyManager);
mPolicyEditor.read();
mSubInfoList = SimSettings.getSortedSubInfoList(getActivity());
mMobileTagMap = initMobileTabTag(mSubInfoList);
try {
if (!mNetworkService.isBandwidthControlEnabled()) {
Log.w(TAG, "No bandwidth control; leaving");
@@ -649,7 +661,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
mTabHost.addTab(buildTabSpec(TAB_3G, R.string.data_usage_tab_3g));
mTabHost.addTab(buildTabSpec(TAB_4G, R.string.data_usage_tab_4g));
} else if (hasReadyMobileRadio(context)) {
mTabHost.addTab(buildTabSpec(TAB_MOBILE, R.string.data_usage_tab_mobile));
addMobileTab(context, mSubInfoList);
}
if (mShowWifi && hasWifiRadio(context)) {
mTabHost.addTab(buildTabSpec(TAB_WIFI, R.string.data_usage_tab_wifi));
@@ -695,6 +707,15 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
mEmptyTabContent);
}
/**
* Build {@link TabSpec} with thin indicator, and empty content.
*/
private TabSpec buildTabSpec(String tag, String title) {
return mTabHost.newTabSpec(tag).setIndicator(title).setContent(
mEmptyTabContent);
}
private OnTabChangeListener mTabListener = new OnTabChangeListener() {
@Override
public void onTabChanged(String tabId) {
@@ -733,11 +754,11 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
// TODO: remove mobile tabs when SIM isn't ready
if (TAB_MOBILE.equals(currentTab)) {
if (isMobileTab(currentTab)) {
setPreferenceTitle(mDataEnabledView, R.string.data_usage_enable_mobile);
setPreferenceTitle(mDisableAtLimitView, R.string.data_usage_disable_mobile_limit);
mTemplate = buildTemplateMobileAll(getActiveSubscriberId(context));
mTemplate = buildTemplateMobileAll(getActiveSubscriberId(context,getSubId(currentTab)));
mDataEnabledSupported = isMobileDataAvailable(getSubId(currentTab));
} else if (TAB_3G.equals(currentTab)) {
setPreferenceTitle(mDataEnabledView, R.string.data_usage_enable_3g);
setPreferenceTitle(mDisableAtLimitView, R.string.data_usage_disable_3g_limit);
@@ -911,13 +932,18 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
*/
private Boolean mMobileDataEnabled;
private boolean isMobileDataEnabled() {
private boolean isMobileDataEnabled(long subId) {
boolean isEnable = false;
if (mMobileDataEnabled != null) {
// TODO: deprecate and remove this once enabled flag is on policy
return mMobileDataEnabled;
// Multiple Subscriptions, the value need to be reseted
isEnable = mMobileDataEnabled.booleanValue();
mMobileDataEnabled = null;
} else {
return mTelephonyManager.getDataEnabled();
//SUB SELECT
isEnable = mTelephonyManager.getDataEnabled() && isMobileDataAvailable(subId);
}
return isEnable;
}
private void setMobileDataEnabled(boolean enabled) {
@@ -974,14 +1000,15 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
}
// TODO: move enabled state directly into policy
if (TAB_MOBILE.equals(mCurrentTab)) {
if (isMobileTab(mCurrentTab)) {
mBinding = true;
mDataEnabled.setChecked(isMobileDataEnabled());
mDataEnabled.setChecked(isMobileDataEnabled(getSubId(mCurrentTab)));
mBinding = false;
}
final NetworkPolicy policy = mPolicyEditor.getPolicy(mTemplate);
if (isNetworkPolicyModifiable(policy)) {
//SUB SELECT
if (isNetworkPolicyModifiable(policy) && isMobileDataAvailable(getSubId(mCurrentTab))) {
mDisableAtLimit.setChecked(policy != null && policy.limitBytes != LIMIT_DISABLED);
if (!isAppDetailMode()) {
mChart.bindNetworkPolicy(policy);
@@ -1082,7 +1109,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
final boolean dataEnabled = !mDataEnabled.isChecked();
final String currentTab = mCurrentTab;
if (TAB_MOBILE.equals(currentTab)) {
if (isMobileTab(currentTab)) {
if (dataEnabled) {
setMobileDataEnabled(true);
} else {
@@ -1225,7 +1252,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
final String totalPhrase = Formatter.formatFileSize(context, totalBytes);
mCycleSummary.setText(totalPhrase);
if (TAB_MOBILE.equals(mCurrentTab) || TAB_3G.equals(mCurrentTab)
if (isMobileTab(mCurrentTab) || TAB_3G.equals(mCurrentTab)
|| TAB_4G.equals(mCurrentTab)) {
if (isAppDetailMode()) {
mDisclaimer.setVisibility(View.GONE);
@@ -1325,6 +1352,11 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
return SystemProperties.get(TEST_SUBSCRIBER_PROP, actualSubscriberId);
}
private static String getActiveSubscriberId(Context context, long subId) {
final TelephonyManager tele = TelephonyManager.from(context);
return tele.getSubscriberId(subId);
}
private DataUsageChartListener mChartListener = new DataUsageChartListener() {
@Override
public void onWarningChanged() {
@@ -1806,7 +1838,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
} else if (TAB_4G.equals(currentTab)) {
message = res.getString(R.string.data_usage_limit_dialog_mobile);
limitBytes = Math.max(5 * GB_IN_BYTES, minLimitBytes);
} else if (TAB_MOBILE.equals(currentTab)) {
} else if (isMobileTab(currentTab)) {
message = res.getString(R.string.data_usage_limit_dialog_mobile);
limitBytes = Math.max(5 * GB_IN_BYTES, minLimitBytes);
} else {
@@ -2176,7 +2208,14 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
*/
private static String computeTabFromIntent(Intent intent) {
final NetworkTemplate template = intent.getParcelableExtra(EXTRA_NETWORK_TEMPLATE);
if (template == null) return null;
if (template == null) {
final long subId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY,
SubscriptionManager.INVALID_SUB_ID);
if (SubscriptionManager.isValidSubId(subId)) {
return TAB_MOBILE + String.valueOf(subId);
}
return null;
}
switch (template.getMatchRule()) {
case MATCH_MOBILE_3G_LOWER:
@@ -2264,8 +2303,33 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
final ConnectivityManager conn = ConnectivityManager.from(context);
final TelephonyManager tele = TelephonyManager.from(context);
final List<SubInfoRecord> subInfoList = SubscriptionManager.getActiveSubInfoList();
// No activated Subscription
if (subInfoList == null) {
return false;
}
// require both supported network and ready SIM
return conn.isNetworkSupported(TYPE_MOBILE) && tele.getSimState() == SIM_STATE_READY;
boolean isReady = true;
for (SubInfoRecord subInfo : subInfoList) {
isReady = isReady & tele.getSimState(subInfo.slotId) == SIM_STATE_READY;
}
return conn.isNetworkSupported(TYPE_MOBILE) && isReady;
}
/*
* TODO: consider adding to TelephonyManager or SubscritpionManager.
*/
public static boolean hasReadyMobileRadio(Context context, long subId) {
if (TEST_RADIOS) {
return SystemProperties.get(TEST_RADIOS_PROP).contains("mobile");
}
final ConnectivityManager conn = ConnectivityManager.from(context);
final TelephonyManager tele = TelephonyManager.from(context);
final int slotId = SubscriptionManager.getSlotId(subId);
final boolean isReady = tele.getSimState(slotId) == SIM_STATE_READY;
return conn.isNetworkSupported(TYPE_MOBILE) && isReady;
}
/**
@@ -2485,4 +2549,53 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
}
};
private void addMobileTab(Context context, List<SubInfoRecord> subInfoList) {
if (subInfoList != null) {
for (SubInfoRecord subInfo : mSubInfoList) {
if (hasReadyMobileRadio(context,subInfo.subId)) {
mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.subId),
subInfo.displayName));
}
}
}
}
/**
* Init a map with subId key and mobile tag name
* @param subInfoList The subscription Info List
* @return The map or null if no activated subscription
*/
private Map<Long, String> initMobileTabTag(List<SubInfoRecord> subInfoList) {
Map<Long,String> map = null;
if (subInfoList != null) {
String mobileTag;
map = new HashMap<Long, String>();
for (SubInfoRecord subInfo : subInfoList) {
mobileTag = TAB_MOBILE + String.valueOf(subInfo.subId);
map.put(subInfo.subId,mobileTag);
}
}
return map;
}
private static boolean isMobileTab(String currentTab) {
return currentTab != null ? currentTab.contains(TAB_MOBILE) : false;
}
private long getSubId(String currentTab) {
Set<Long> set = mMobileTagMap.keySet();
for (Long subId : set) {
if (mMobileTagMap.get(subId).equals(currentTab)) {
return subId;
}
}
Log.e(TAG, "currentTab = " + currentTab + " non mobile tab called this function");
return -1;
}
//SUB SELECT
private boolean isMobileDataAvailable(long subId) {
long[] subIds = SubscriptionManager.getSubId(PhoneConstants.SUB1);
return subIds[0] == subId;
}
}

View File

@@ -43,6 +43,8 @@ import android.provider.Settings.SettingNotFoundException;
import android.security.KeyStore;
import android.service.trust.TrustAgentService;
import android.telephony.TelephonyManager;
import android.telephony.SubscriptionManager;
import android.telephony.SubInfoRecord;
import android.text.TextUtils;
import android.util.Log;
@@ -299,13 +301,8 @@ public class SecuritySettings extends SettingsPreferenceFragment
if (!mIsPrimary || !tm.hasIccCard()) {
root.removePreference(root.findPreference(KEY_SIM_LOCK));
} else {
// Disable SIM lock if sim card is missing or unknown
if ((TelephonyManager.getDefault().getSimState() ==
TelephonyManager.SIM_STATE_ABSENT) ||
(TelephonyManager.getDefault().getSimState() ==
TelephonyManager.SIM_STATE_UNKNOWN)) {
root.findPreference(KEY_SIM_LOCK).setEnabled(false);
}
// Disable SIM lock if there is no ready SIM card.
root.findPreference(KEY_SIM_LOCK).setEnabled(isSimReady());
}
if (Settings.System.getInt(getContentResolver(),
Settings.System.LOCK_TO_APP_ENABLED, 0) != 0) {
@@ -372,6 +369,24 @@ public class SecuritySettings extends SettingsPreferenceFragment
return root;
}
/* Return true if a SIM is ready for locking.
* TODO: consider adding to TelephonyManager or SubscritpionManasger.
*/
private static boolean isSimReady() {
int simState = TelephonyManager.SIM_STATE_UNKNOWN;
final List<SubInfoRecord> subInfoList = SubscriptionManager.getActiveSubInfoList();
if (subInfoList != null) {
for (SubInfoRecord subInfo : subInfoList) {
simState = TelephonyManager.getDefault().getSimState(subInfo.slotId);
if((simState != TelephonyManager.SIM_STATE_ABSENT) &&
(simState != TelephonyManager.SIM_STATE_UNKNOWN)){
return true;
}
}
}
return false;
}
private static ArrayList<TrustAgentComponentInfo> getActiveTrustAgents(
PackageManager pm, LockPatternUtils utils) {
ArrayList<TrustAgentComponentInfo> result = new ArrayList<TrustAgentComponentInfo>();

View File

@@ -876,9 +876,7 @@ public final class Utils {
final TelephonyManager tm =
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
// TODO: Uncomment to re-enable SimSettings.
return tm.getSimCount() > 0;
//return false;
}
/**

View File

@@ -36,21 +36,12 @@ import android.os.SystemProperties;
import android.os.UserHandle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.telephony.CellBroadcastMessage;
import android.telephony.PhoneNumberUtils;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListAdapter;
import android.widget.Toast;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.PhoneStateIntentReceiver;
import com.android.internal.util.ArrayUtils;
import com.android.settings.R;
import com.android.settings.Utils;
@@ -59,13 +50,6 @@ import java.lang.ref.WeakReference;
/**
* Display the following information
* # Phone Number
* # Network
* # Roaming
* # Device Id (IMEI in GSM and MEID in CDMA)
* # Network type
* # Operator info (area info cell broadcast for Brazil)
* # Signal Strength
* # Battery Strength : TODO
* # Uptime
* # Awake Time
@@ -74,53 +58,14 @@ import java.lang.ref.WeakReference;
*/
public class Status extends PreferenceActivity {
private static final String KEY_DATA_STATE = "data_state";
private static final String KEY_SERVICE_STATE = "service_state";
private static final String KEY_OPERATOR_NAME = "operator_name";
private static final String KEY_ROAMING_STATE = "roaming_state";
private static final String KEY_NETWORK_TYPE = "network_type";
private static final String KEY_LATEST_AREA_INFO = "latest_area_info";
private static final String KEY_PHONE_NUMBER = "number";
private static final String KEY_IMEI_SV = "imei_sv";
private static final String KEY_IMEI = "imei";
private static final String KEY_PRL_VERSION = "prl_version";
private static final String KEY_MIN_NUMBER = "min_number";
private static final String KEY_MEID_NUMBER = "meid_number";
private static final String KEY_SIGNAL_STRENGTH = "signal_strength";
private static final String KEY_BATTERY_STATUS = "battery_status";
private static final String KEY_BATTERY_LEVEL = "battery_level";
private static final String KEY_IP_ADDRESS = "wifi_ip_address";
private static final String KEY_WIFI_MAC_ADDRESS = "wifi_mac_address";
private static final String KEY_BT_ADDRESS = "bt_address";
private static final String KEY_SERIAL_NUMBER = "serial_number";
private static final String KEY_ICC_ID = "icc_id";
private static final String KEY_WIMAX_MAC_ADDRESS = "wimax_mac_address";
private static final String[] PHONE_RELATED_ENTRIES = {
KEY_DATA_STATE,
KEY_SERVICE_STATE,
KEY_OPERATOR_NAME,
KEY_ROAMING_STATE,
KEY_NETWORK_TYPE,
KEY_LATEST_AREA_INFO,
KEY_PHONE_NUMBER,
KEY_IMEI,
KEY_IMEI_SV,
KEY_PRL_VERSION,
KEY_MIN_NUMBER,
KEY_MEID_NUMBER,
KEY_SIGNAL_STRENGTH,
KEY_ICC_ID
};
static final String CB_AREA_INFO_RECEIVED_ACTION =
"android.cellbroadcastreceiver.CB_AREA_INFO_RECEIVED";
static final String GET_LATEST_CB_AREA_INFO_ACTION =
"android.cellbroadcastreceiver.GET_LATEST_CB_AREA_INFO";
// Require the sender to have this permission to prevent third-party spoofing.
static final String CB_AREA_INFO_SENDER_PERMISSION =
"android.permission.RECEIVE_EMERGENCY_BROADCAST";
private static final String KEY_SIM_STATUS = "sim_status";
// Broadcasts to listen to for connectivity changes.
private static final String[] CONNECTIVITY_INTENTS = {
@@ -130,26 +75,18 @@ public class Status extends PreferenceActivity {
WifiManager.NETWORK_STATE_CHANGED_ACTION,
};
private static final int EVENT_SIGNAL_STRENGTH_CHANGED = 200;
private static final int EVENT_SERVICE_STATE_CHANGED = 300;
private static final int EVENT_UPDATE_STATS = 500;
private static final int EVENT_UPDATE_CONNECTIVITY = 600;
private ConnectivityManager mCM;
private TelephonyManager mTelephonyManager;
private WifiManager mWifiManager;
private Phone mPhone = null;
private PhoneStateIntentReceiver mPhoneStateReceiver;
private Resources mRes;
private boolean mShowLatestAreaInfo;
private String mUnknown;
private String mUnavailable;
private Preference mSignalStrength;
private Preference mUptime;
private Preference mBatteryStatus;
private Preference mBatteryLevel;
@@ -175,15 +112,6 @@ public class Status extends PreferenceActivity {
}
switch (msg.what) {
case EVENT_SIGNAL_STRENGTH_CHANGED:
status.updateSignalStrength();
break;
case EVENT_SERVICE_STATE_CHANGED:
ServiceState serviceState = status.mPhoneStateReceiver.getServiceState();
status.updateServiceState(serviceState);
break;
case EVENT_UPDATE_STATS:
status.updateTimes();
sendEmptyMessageDelayed(EVENT_UPDATE_STATS, 1000);
@@ -208,32 +136,6 @@ public class Status extends PreferenceActivity {
}
};
private PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
@Override
public void onDataConnectionStateChanged(int state) {
updateDataState();
updateNetworkType();
}
};
private BroadcastReceiver mAreaInfoReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (CB_AREA_INFO_RECEIVED_ACTION.equals(action)) {
Bundle extras = intent.getExtras();
if (extras == null) {
return;
}
CellBroadcastMessage cbMessage = (CellBroadcastMessage) extras.get("message");
if (cbMessage != null && cbMessage.getServiceCategory() == 50) {
String latestAreaInfo = cbMessage.getMessageBody();
updateAreaInfo(latestAreaInfo);
}
}
}
};
private IntentFilter mConnectivityIntentFilter;
private final BroadcastReceiver mConnectivityReceiver = new BroadcastReceiver() {
@Override
@@ -260,7 +162,6 @@ public class Status extends PreferenceActivity {
mHandler = new MyHandler(this);
mCM = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
mTelephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
mWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
addPreferencesFromResource(R.xml.device_info_status);
@@ -275,76 +176,9 @@ public class Status extends PreferenceActivity {
mUnknown = mRes.getString(R.string.device_info_default);
mUnavailable = mRes.getString(R.string.status_unavailable);
if (UserHandle.myUserId() == UserHandle.USER_OWNER) {
mPhone = PhoneFactory.getDefaultPhone();
}
// Note - missing in zaku build, be careful later...
mSignalStrength = findPreference(KEY_SIGNAL_STRENGTH);
mUptime = findPreference("up_time");
if (mPhone == null || Utils.isWifiOnly(getApplicationContext())) {
for (String key : PHONE_RELATED_ENTRIES) {
removePreferenceFromScreen(key);
}
} else {
// NOTE "imei" is the "Device ID" since it represents
// the IMEI in GSM and the MEID in CDMA
if (mPhone.getPhoneName().equals("CDMA")) {
setSummaryText(KEY_MEID_NUMBER, mPhone.getMeid());
setSummaryText(KEY_MIN_NUMBER, mPhone.getCdmaMin());
if (getResources().getBoolean(R.bool.config_msid_enable)) {
findPreference(KEY_MIN_NUMBER).setTitle(R.string.status_msid_number);
}
setSummaryText(KEY_PRL_VERSION, mPhone.getCdmaPrlVersion());
removePreferenceFromScreen(KEY_IMEI_SV);
if (mPhone.getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE) {
// Show ICC ID and IMEI for LTE device
setSummaryText(KEY_ICC_ID, mPhone.getIccSerialNumber());
setSummaryText(KEY_IMEI, mPhone.getImei());
} else {
// device is not GSM/UMTS, do not display GSM/UMTS features
// check Null in case no specified preference in overlay xml
removePreferenceFromScreen(KEY_IMEI);
removePreferenceFromScreen(KEY_ICC_ID);
}
} else {
setSummaryText(KEY_IMEI, mPhone.getDeviceId());
setSummaryText(KEY_IMEI_SV,
((TelephonyManager) getSystemService(TELEPHONY_SERVICE))
.getDeviceSoftwareVersion());
// device is not CDMA, do not display CDMA features
// check Null in case no specified preference in overlay xml
removePreferenceFromScreen(KEY_PRL_VERSION);
removePreferenceFromScreen(KEY_MEID_NUMBER);
removePreferenceFromScreen(KEY_MIN_NUMBER);
removePreferenceFromScreen(KEY_ICC_ID);
// only show area info when SIM country is Brazil
if ("br".equals(mTelephonyManager.getSimCountryIso())) {
mShowLatestAreaInfo = true;
}
}
String rawNumber = mTelephonyManager.getLine1Number(); // may be null or empty
String formattedNumber = null;
if (!TextUtils.isEmpty(rawNumber)) {
formattedNumber = PhoneNumberUtils.formatNumber(rawNumber);
}
// If formattedNumber is null or empty, it'll display as "Unknown".
setSummaryText(KEY_PHONE_NUMBER, formattedNumber);
mPhoneStateReceiver = new PhoneStateIntentReceiver(this, mHandler);
mPhoneStateReceiver.notifySignalStrength(EVENT_SIGNAL_STRENGTH_CHANGED);
mPhoneStateReceiver.notifyServiceState(EVENT_SERVICE_STATE_CHANGED);
if (!mShowLatestAreaInfo) {
removePreferenceFromScreen(KEY_LATEST_AREA_INFO);
}
}
if (!hasBluetooth()) {
getPreferenceScreen().removePreference(mBtAddress);
mBtAddress = null;
@@ -394,24 +228,6 @@ public class Status extends PreferenceActivity {
@Override
protected void onResume() {
super.onResume();
if (mPhone != null && !Utils.isWifiOnly(getApplicationContext())) {
mPhoneStateReceiver.registerIntent();
updateSignalStrength();
updateServiceState(mPhone.getServiceState());
updateDataState();
mTelephonyManager.listen(mPhoneStateListener,
PhoneStateListener.LISTEN_DATA_CONNECTION_STATE);
if (mShowLatestAreaInfo) {
registerReceiver(mAreaInfoReceiver, new IntentFilter(CB_AREA_INFO_RECEIVED_ACTION),
CB_AREA_INFO_SENDER_PERMISSION, null);
// Ask CellBroadcastReceiver to broadcast the latest area info received
Intent getLatestIntent = new Intent(GET_LATEST_CB_AREA_INFO_ACTION);
sendBroadcastAsUser(getLatestIntent, UserHandle.ALL,
CB_AREA_INFO_SENDER_PERMISSION);
}
}
registerReceiver(mConnectivityReceiver, mConnectivityIntentFilter,
android.Manifest.permission.CHANGE_NETWORK_STATE, null);
registerReceiver(mBatteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
@@ -422,13 +238,6 @@ public class Status extends PreferenceActivity {
public void onPause() {
super.onPause();
if (mPhone != null && !Utils.isWifiOnly(getApplicationContext())) {
mPhoneStateReceiver.unregisterIntent();
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
}
if (mShowLatestAreaInfo) {
unregisterReceiver(mAreaInfoReceiver);
}
unregisterReceiver(mBatteryInfoReceiver);
unregisterReceiver(mConnectivityReceiver);
mHandler.removeMessages(EVENT_UPDATE_STATS);
@@ -469,100 +278,6 @@ public class Status extends PreferenceActivity {
}
}
private void updateNetworkType() {
// Whether EDGE, UMTS, etc...
String networktype = null;
if (TelephonyManager.NETWORK_TYPE_UNKNOWN != mTelephonyManager.getNetworkType()) {
networktype = mTelephonyManager.getNetworkTypeName();
}
setSummaryText(KEY_NETWORK_TYPE, networktype);
}
private void updateDataState() {
int state = mTelephonyManager.getDataState();
String display = mRes.getString(R.string.radioInfo_unknown);
switch (state) {
case TelephonyManager.DATA_CONNECTED:
display = mRes.getString(R.string.radioInfo_data_connected);
break;
case TelephonyManager.DATA_SUSPENDED:
display = mRes.getString(R.string.radioInfo_data_suspended);
break;
case TelephonyManager.DATA_CONNECTING:
display = mRes.getString(R.string.radioInfo_data_connecting);
break;
case TelephonyManager.DATA_DISCONNECTED:
display = mRes.getString(R.string.radioInfo_data_disconnected);
break;
}
setSummaryText(KEY_DATA_STATE, display);
}
private void updateServiceState(ServiceState serviceState) {
int state = serviceState.getState();
String display = mRes.getString(R.string.radioInfo_unknown);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
display = mRes.getString(R.string.radioInfo_service_in);
break;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
display = mRes.getString(R.string.radioInfo_service_out);
break;
case ServiceState.STATE_POWER_OFF:
display = mRes.getString(R.string.radioInfo_service_off);
break;
}
setSummaryText(KEY_SERVICE_STATE, display);
if (serviceState.getRoaming()) {
setSummaryText(KEY_ROAMING_STATE, mRes.getString(R.string.radioInfo_roaming_in));
} else {
setSummaryText(KEY_ROAMING_STATE, mRes.getString(R.string.radioInfo_roaming_not));
}
setSummaryText(KEY_OPERATOR_NAME, serviceState.getOperatorAlphaLong());
}
private void updateAreaInfo(String areaInfo) {
if (areaInfo != null) {
setSummaryText(KEY_LATEST_AREA_INFO, areaInfo);
}
}
void updateSignalStrength() {
// TODO PhoneStateIntentReceiver is deprecated and PhoneStateListener
// should probably used instead.
// not loaded in some versions of the code (e.g., zaku)
if (mSignalStrength != null) {
int state =
mPhoneStateReceiver.getServiceState().getState();
Resources r = getResources();
if ((ServiceState.STATE_OUT_OF_SERVICE == state) ||
(ServiceState.STATE_POWER_OFF == state)) {
mSignalStrength.setSummary("0");
}
int signalDbm = mPhoneStateReceiver.getSignalStrengthDbm();
if (-1 == signalDbm) signalDbm = 0;
int signalAsu = mPhoneStateReceiver.getSignalStrengthLevelAsu();
if (-1 == signalAsu) signalAsu = 0;
mSignalStrength.setSummary(String.valueOf(signalDbm) + " "
+ r.getString(R.string.radioInfo_display_dbm) + " "
+ String.valueOf(signalAsu) + " "
+ r.getString(R.string.radioInfo_display_asu));
}
}
private void setWimaxStatus() {
if (mWimaxMacAddress != null) {
String macAddress = SystemProperties.get("net.wimax.mac.address", mUnavailable);

View File

@@ -20,24 +20,31 @@ import android.provider.SearchIndexableResource;
import com.android.settings.R;
import android.app.AlertDialog;
import android.app.Fragment;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.ContentUris;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.UserHandle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceCategory;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceScreen;
import android.provider.Telephony;
import android.telephony.SubInfoRecord;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.PhoneNumberUtils;
import android.telecom.PhoneAccount;
import android.telephony.CellInfo;
import android.text.TextUtils;
@@ -53,6 +60,7 @@ import android.widget.Spinner;
import android.widget.TextView;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.TelephonyIntents;
import com.android.settings.RestrictedSettingsFragment;
import com.android.settings.SettingsPreferenceFragment;
@@ -64,6 +72,8 @@ import com.android.settings.search.Indexable.SearchIndexProvider;
import com.android.settings.search.SearchIndexableRaw;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class SimSettings extends RestrictedSettingsFragment implements Indexable {
@@ -75,9 +85,31 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
private static final String KEY_CALLS = "sim_calls";
private static final String KEY_SMS = "sim_sms";
private static final String KEY_ACTIVITIES = "activities";
private static final int ID_INDEX = 0;
private static final int NAME_INDEX = 1;
private static final int APN_INDEX = 2;
private static final int PROXY_INDEX = 3;
private static final int PORT_INDEX = 4;
private static final int USER_INDEX = 5;
private static final int SERVER_INDEX = 6;
private static final int PASSWORD_INDEX = 7;
private static final int MMSC_INDEX = 8;
private static final int MCC_INDEX = 9;
private static final int MNC_INDEX = 10;
private static final int NUMERIC_INDEX = 11;
private static final int MMSPROXY_INDEX = 12;
private static final int MMSPORT_INDEX = 13;
private static final int AUTH_TYPE_INDEX = 14;
private static final int TYPE_INDEX = 15;
private static final int PROTOCOL_INDEX = 16;
private static final int CARRIER_ENABLED_INDEX = 17;
private static final int BEARER_INDEX = 18;
private static final int ROAMING_PROTOCOL_INDEX = 19;
private static final int MVNO_TYPE_INDEX = 20;
private static final int MVNO_MATCH_DATA_INDEX = 21;
/**
* By UX design we have use only one Subscription Information(SubInfo) record per SIM slot.
* By UX design we use only one Subscription Information(SubInfo) record per SIM slot.
* mAvalableSubInfos is the list of SubInfos we present to the user.
* mSubInfoList is the list of all SubInfos.
*/
@@ -88,7 +120,36 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
private SubInfoRecord mCalls = null;
private SubInfoRecord mSMS = null;
private PreferenceCategory mSimCards = null;
private int mNumSims;
/**
* Standard projection for the interesting columns of a normal note.
*/
private static final String[] sProjection = new String[] {
Telephony.Carriers._ID, // 0
Telephony.Carriers.NAME, // 1
Telephony.Carriers.APN, // 2
Telephony.Carriers.PROXY, // 3
Telephony.Carriers.PORT, // 4
Telephony.Carriers.USER, // 5
Telephony.Carriers.SERVER, // 6
Telephony.Carriers.PASSWORD, // 7
Telephony.Carriers.MMSC, // 8
Telephony.Carriers.MCC, // 9
Telephony.Carriers.MNC, // 10
Telephony.Carriers.NUMERIC, // 11
Telephony.Carriers.MMSPROXY,// 12
Telephony.Carriers.MMSPORT, // 13
Telephony.Carriers.AUTH_TYPE, // 14
Telephony.Carriers.TYPE, // 15
Telephony.Carriers.PROTOCOL, // 16
Telephony.Carriers.CARRIER_ENABLED, // 17
Telephony.Carriers.BEARER, // 18
Telephony.Carriers.ROAMING_PROTOCOL, // 19
Telephony.Carriers.MVNO_TYPE, // 20
Telephony.Carriers.MVNO_MATCH_DATA // 21
};
public SimSettings() {
super(DISALLOW_CONFIG_SIM);
@@ -112,14 +173,14 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
addPreferencesFromResource(R.xml.sim_settings);
final PreferenceCategory simCards = (PreferenceCategory)findPreference(SIM_CARD_CATEGORY);
mSimCards = (PreferenceCategory)findPreference(SIM_CARD_CATEGORY);
final int numSlots = tm.getSimCount();
mAvailableSubInfos = new ArrayList<SubInfoRecord>(numSlots);
mNumSims = 0;
for (int i = 0; i < numSlots; ++i) {
final SubInfoRecord sir = findRecordBySlotId(i);
simCards.addPreference(new SimPreference(getActivity(), sir, i));
mSimCards.addPreference(new SimPreference(getActivity(), sir, i));
mAvailableSubInfos.add(sir);
if (sir != null) {
mNumSims++;
@@ -129,6 +190,22 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
updateActivitesCategory();
}
private void updateAvailableSubInfos(){
final TelephonyManager tm =
(TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE);
final int numSlots = tm.getSimCount();
mNumSims = 0;
mAvailableSubInfos = new ArrayList<SubInfoRecord>(numSlots);
for (int i = 0; i < numSlots; ++i) {
final SubInfoRecord sir = findRecordBySlotId(i);
mAvailableSubInfos.add(sir);
if (sir != null) {
mNumSims++;
}
}
}
private void updateAllOptions() {
updateSimSlotValues();
updateActivitesCategory();
@@ -136,12 +213,10 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
private void updateSimSlotValues() {
SubscriptionManager.getAllSubInfoList();
final PreferenceCategory simCards = (PreferenceCategory)findPreference(SIM_CARD_CATEGORY);
final PreferenceScreen prefScreen = getPreferenceScreen();
final int prefSize = prefScreen.getPreferenceCount();
final int prefSize = mSimCards.getPreferenceCount();
for (int i = 0; i < prefSize; ++i) {
Preference pref = prefScreen.getPreference(i);
Preference pref = mSimCards.getPreference(i);
if (pref instanceof SimPreference) {
((SimPreference)pref).update();
}
@@ -198,7 +273,9 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
private void updateSmsValues() {
final DropDownPreference simPref = (DropDownPreference) findPreference(KEY_SMS);
final SubInfoRecord sir = findRecordBySubId(SubscriptionManager.getDefaultSmsSubId());
if (sir != null) {
if (mSubInfoList.size() == 1) {
simPref.setSelectedItem(mSubInfoList.get(0).slotId + 1);
} else if (sir != null) {
simPref.setSelectedItem(sir.slotId + 1);
}
simPref.setEnabled(mNumSims >= 1);
@@ -207,7 +284,9 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
private void updateCellularDataValues() {
final DropDownPreference simPref = (DropDownPreference) findPreference(KEY_CELLULAR_DATA);
final SubInfoRecord sir = findRecordBySubId(SubscriptionManager.getDefaultDataSubId());
if (sir != null) {
if (mSubInfoList.size() == 1) {
simPref.setSelectedItem(mSubInfoList.get(0).slotId);
} else if (sir != null) {
simPref.setSelectedItem(sir.slotId);
}
simPref.setEnabled(mNumSims >= 1);
@@ -216,7 +295,9 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
private void updateCallValues() {
final DropDownPreference simPref = (DropDownPreference) findPreference(KEY_CALLS);
final SubInfoRecord sir = findRecordBySubId(SubscriptionManager.getDefaultVoiceSubId());
if (sir != null) {
if (mSubInfoList.size() == 1) {
simPref.setSelectedItem(mSubInfoList.get(0).slotId + 1);
} else if (sir != null) {
simPref.setSelectedItem(sir.slotId + 1);
}
simPref.setEnabled(mNumSims >= 1);
@@ -225,6 +306,9 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
@Override
public void onResume() {
super.onResume();
mSubInfoList = SubscriptionManager.getActiveSubInfoList();
updateAvailableSubInfos();
updateAllOptions();
}
@@ -318,6 +402,31 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
}
}
public String getCarrierName() {
Uri mUri = ContentUris.withAppendedId(Telephony.Carriers.CONTENT_URI, mSubInfoRecord.subId);
Cursor mCursor = getActivity().managedQuery(mUri, sProjection, null, null);
mCursor.moveToFirst();
return mCursor.getString(1);
}
public String getFormattedPhoneNumber() {
try{
final String rawNumber = PhoneFactory.getPhone(mSlotId).getLine1Number();
String formattedNumber = null;
if (!TextUtils.isEmpty(rawNumber)) {
formattedNumber = PhoneNumberUtils.formatNumber(rawNumber);
}
return formattedNumber;
} catch (java.lang.IllegalStateException ise){
return "Unknown";
}
}
public SubInfoRecord getSubInfoRecord() {
return mSubInfoRecord;
}
public void createEditDialog(SimPreference simPref) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
@@ -329,10 +438,10 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
nameText.setText(mSubInfoRecord.displayName);
TextView numberView = (TextView)dialogLayout.findViewById(R.id.number);
numberView.setText(mSubInfoRecord.number);
numberView.setText(simPref.getFormattedPhoneNumber());
TextView carrierView = (TextView)dialogLayout.findViewById(R.id.carrier);
carrierView.setText(mSubInfoRecord.displayName);
carrierView.setText(getCarrierName());
builder.setTitle(R.string.sim_editor_title);
@@ -368,6 +477,29 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
}
}
/**
* Sort Subscription List in SIM Id, Subscription Id
* @param context The Context
* @return Sorted Subscription List or NULL if no activated Subscription
*/
public static List<SubInfoRecord> getSortedSubInfoList(Context context) {
List<SubInfoRecord> infoList = SubscriptionManager.getActiveSubInfoList();
if (infoList != null) {
Collections.sort(infoList, new Comparator<SubInfoRecord>() {
@Override
public int compare(SubInfoRecord arg0, SubInfoRecord arg1) {
int flag = arg0.slotId - arg1.slotId;
if (flag == 0) {
return (int) (arg0.subId - arg1.subId);
}
return flag;
}
});
}
return infoList;
}
/**
* For search
*/