Loading Android.mk +5 −0 Original line number Diff line number Diff line Loading @@ -238,9 +238,12 @@ LOCAL_SRC_FILES += \ media/java/android/media/IRingtonePlayer.aidl \ telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \ telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \ telephony/java/com/android/internal/telephony/msim/IPhoneSubInfoMSim.aidl \ telephony/java/com/android/internal/telephony/ITelephony.aidl \ telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl \ telephony/java/com/android/internal/telephony/ISms.aidl \ telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \ telephony/java/com/android/internal/telephony/ITelephonyRegistryMSim.aidl \ telephony/java/com/android/internal/telephony/IWapPushManager.aidl \ wifi/java/android/net/wifi/IWifiManager.aidl \ wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \ Loading Loading @@ -352,7 +355,9 @@ aidl_files := \ frameworks/base/location/java/com/android/internal/location/ProviderRequest.aidl \ frameworks/base/telephony/java/android/telephony/ServiceState.aidl \ frameworks/base/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \ frameworks/base/telephony/java/com/android/internal/telephony/msim/IPhoneSubInfoMSim.aidl \ frameworks/base/telephony/java/com/android/internal/telephony/ITelephony.aidl \ frameworks/base/telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl \ gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl $(gen): PRIVATE_SRC_FILES := $(aidl_files) Loading core/java/android/app/ContextImpl.java +10 −0 Original line number Diff line number Diff line /* * Copyright (C) 2006 The Android Open Source Project * This code has been modified. Portions copyright (C) 2010, T-Mobile USA, Inc. * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -98,6 +100,7 @@ import android.os.UserHandle; import android.os.SystemVibrator; import android.os.UserManager; import android.os.storage.StorageManager; import android.telephony.MSimTelephonyManager; import android.telephony.TelephonyManager; import android.content.ClipboardManager; import android.util.AndroidRuntimeException; Loading Loading @@ -489,6 +492,13 @@ class ContextImpl extends Context { return new TelephonyManager(ctx.getOuterContext()); }}); if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { registerService(MSIM_TELEPHONY_SERVICE, new ServiceFetcher() { public Object createService(ContextImpl ctx) { return new MSimTelephonyManager(ctx.getOuterContext()); }}); } registerService(UI_MODE_SERVICE, new ServiceFetcher() { public Object createService(ContextImpl ctx) { return new UiModeManager(); Loading core/java/android/content/Context.java +15 −1 Original line number Diff line number Diff line /* * Copyright (C) 2006 The Android Open Source Project * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. * * Not a Contribution. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -2135,6 +2138,17 @@ public abstract class Context { */ public static final String TELEPHONY_SERVICE = "phone"; /** * Use with {@link #getSystemService} to retrieve a * {android.telephony.MSimTelephonyManager} for handling the management * of the telephony features of the multi sim device. * * @see #getSystemService * @see android.telephony.MSimTelephonyManager * @hide */ public static final String MSIM_TELEPHONY_SERVICE = "phone_msim"; /** * Use with {@link #getSystemService} to retrieve a * {@link android.text.ClipboardManager} for accessing and modifying Loading core/java/android/net/MobileDataStateTracker.java +68 −19 Original line number Diff line number Diff line /* * Copyright (C) 2008 The Android Open Source Project * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. * * Not a Contribution. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -28,12 +31,14 @@ import android.os.Message; import android.os.Messenger; import android.os.RemoteException; import android.os.ServiceManager; import android.telephony.MSimTelephonyManager; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Slog; import com.android.internal.telephony.DctConstants; import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.msim.ITelephonyMSim; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.util.AsyncChannel; Loading @@ -57,6 +62,7 @@ public class MobileDataStateTracker implements NetworkStateTracker { private PhoneConstants.DataState mMobileDataState; private ITelephony mPhoneService; private ITelephonyMSim mMSimPhoneService; private String mApnType; private NetworkInfo mNetworkInfo; Loading Loading @@ -315,6 +321,13 @@ public class MobileDataStateTracker implements NetworkStateTracker { } private void getPhoneService(boolean forceRefresh) { if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { if (mMSimPhoneService == null || forceRefresh) { mMSimPhoneService = ITelephonyMSim.Stub.asInterface( ServiceManager.getService("phone_msim")); } return; } if ((mPhoneService == null) || forceRefresh) { mPhoneService = ITelephony.Stub.asInterface(ServiceManager.getService("phone")); } Loading Loading @@ -343,6 +356,7 @@ public class MobileDataStateTracker implements NetworkStateTracker { networkTypeStr = "edge"; break; case TelephonyManager.NETWORK_TYPE_UMTS: case TelephonyManager.NETWORK_TYPE_TD_SCDMA: networkTypeStr = "umts"; break; case TelephonyManager.NETWORK_TYPE_HSDPA: Loading Loading @@ -498,6 +512,23 @@ public class MobileDataStateTracker implements NetworkStateTracker { * RemoteException and need to re-reference the service. */ for (int retry = 0; retry < 2; retry++) { if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { if (mMSimPhoneService == null) { loge("Ignoring mobile radio request because " + "could not acquire MSim Phone Service"); break; } try { boolean result = true; for (int i = 0; i < MSimTelephonyManager.getDefault().getPhoneCount(); i++) { result = result && mMSimPhoneService.setRadio(turnOn, i); } return result; } catch (RemoteException e) { if (retry == 0) getPhoneService(true); } } else { if (mPhoneService == null) { loge("Ignoring mobile radio request because could not acquire PhoneService"); break; Loading @@ -509,6 +540,7 @@ public class MobileDataStateTracker implements NetworkStateTracker { if (retry == 0) getPhoneService(true); } } } loge("Could not set radio power to " + (turnOn ? "on" : "off")); return false; Loading Loading @@ -637,6 +669,22 @@ public class MobileDataStateTracker implements NetworkStateTracker { * RemoteException and need to re-reference the service. */ for (int retry = 0; retry < 2; retry++) { if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { if (mMSimPhoneService == null) { loge("Ignoring feature request because could not acquire MSim Phone Service"); break; } try { if (enable) { return mMSimPhoneService.enableApnType(apnType); } else { return mMSimPhoneService.disableApnType(apnType); } } catch (RemoteException e) { if (retry == 0) getPhoneService(true); } } else { if (mPhoneService == null) { loge("Ignoring feature request because could not acquire PhoneService"); break; Loading @@ -652,6 +700,7 @@ public class MobileDataStateTracker implements NetworkStateTracker { if (retry == 0) getPhoneService(true); } } } loge("Could not " + (enable ? "enable" : "disable") + " APN type \"" + apnType + "\""); return PhoneConstants.APN_REQUEST_FAILED; Loading core/java/android/provider/Settings.java +64 −0 Original line number Diff line number Diff line /* * Copyright (C) 2006 The Android Open Source Project * Copyright (c) 2013 The Linux Foundation. All rights reserved. * * Not a Contribution. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -6914,6 +6917,67 @@ public final class Settings { public static boolean putFloat(ContentResolver cr, String name, float value) { return putString(cr, name, Float.toString(value)); } /** * Subscription to be used for voice call on a multi sim device. The supported values * are 0 = SUB1, 1 = SUB2 and etc. * @hide */ public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; /** * Used to provide option to user to select subscription during dial. * The supported values are 0 = disable or 1 = enable prompt. * @hide */ public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; /** * Subscription to be used for data call on a multi sim device. The supported values * are 0 = SUB1, 1 = SUB2 and etc. * @hide */ public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; /** * Subscription to be used for SMS on a multi sim device. The supported values * are 0 = SUB1, 1 = SUB2 and etc. * @hide */ public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; /** * Used to provide option to user to select subscription during send SMS. * The value 1 - enable, 0 - disable * @hide */ public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; /** User preferred subscriptions setting. * This holds the details of the user selected subscription from the card and * the activation status. Each settings string have the coma separated values * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index * @hide */ public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", "user_preferred_sub2","user_preferred_sub3"}; /** * Subscription to be used decide priority sub on a multi sim device. The supported values * are 0 = SUB1, 1 = SUB2, 2 = SUB3. * @hide */ public static final String MULTI_SIM_PRIORITY_SUBSCRIPTION = "multi_sim_priority"; /** * To know the status of tune away. The supported values * are false = disable, true = enable. * @hide */ public static final String TUNE_AWAY_STATUS = "tune_away"; } /** Loading Loading
Android.mk +5 −0 Original line number Diff line number Diff line Loading @@ -238,9 +238,12 @@ LOCAL_SRC_FILES += \ media/java/android/media/IRingtonePlayer.aidl \ telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \ telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \ telephony/java/com/android/internal/telephony/msim/IPhoneSubInfoMSim.aidl \ telephony/java/com/android/internal/telephony/ITelephony.aidl \ telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl \ telephony/java/com/android/internal/telephony/ISms.aidl \ telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \ telephony/java/com/android/internal/telephony/ITelephonyRegistryMSim.aidl \ telephony/java/com/android/internal/telephony/IWapPushManager.aidl \ wifi/java/android/net/wifi/IWifiManager.aidl \ wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \ Loading Loading @@ -352,7 +355,9 @@ aidl_files := \ frameworks/base/location/java/com/android/internal/location/ProviderRequest.aidl \ frameworks/base/telephony/java/android/telephony/ServiceState.aidl \ frameworks/base/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \ frameworks/base/telephony/java/com/android/internal/telephony/msim/IPhoneSubInfoMSim.aidl \ frameworks/base/telephony/java/com/android/internal/telephony/ITelephony.aidl \ frameworks/base/telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl \ gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl $(gen): PRIVATE_SRC_FILES := $(aidl_files) Loading
core/java/android/app/ContextImpl.java +10 −0 Original line number Diff line number Diff line /* * Copyright (C) 2006 The Android Open Source Project * This code has been modified. Portions copyright (C) 2010, T-Mobile USA, Inc. * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -98,6 +100,7 @@ import android.os.UserHandle; import android.os.SystemVibrator; import android.os.UserManager; import android.os.storage.StorageManager; import android.telephony.MSimTelephonyManager; import android.telephony.TelephonyManager; import android.content.ClipboardManager; import android.util.AndroidRuntimeException; Loading Loading @@ -489,6 +492,13 @@ class ContextImpl extends Context { return new TelephonyManager(ctx.getOuterContext()); }}); if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { registerService(MSIM_TELEPHONY_SERVICE, new ServiceFetcher() { public Object createService(ContextImpl ctx) { return new MSimTelephonyManager(ctx.getOuterContext()); }}); } registerService(UI_MODE_SERVICE, new ServiceFetcher() { public Object createService(ContextImpl ctx) { return new UiModeManager(); Loading
core/java/android/content/Context.java +15 −1 Original line number Diff line number Diff line /* * Copyright (C) 2006 The Android Open Source Project * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. * * Not a Contribution. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -2135,6 +2138,17 @@ public abstract class Context { */ public static final String TELEPHONY_SERVICE = "phone"; /** * Use with {@link #getSystemService} to retrieve a * {android.telephony.MSimTelephonyManager} for handling the management * of the telephony features of the multi sim device. * * @see #getSystemService * @see android.telephony.MSimTelephonyManager * @hide */ public static final String MSIM_TELEPHONY_SERVICE = "phone_msim"; /** * Use with {@link #getSystemService} to retrieve a * {@link android.text.ClipboardManager} for accessing and modifying Loading
core/java/android/net/MobileDataStateTracker.java +68 −19 Original line number Diff line number Diff line /* * Copyright (C) 2008 The Android Open Source Project * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. * * Not a Contribution. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -28,12 +31,14 @@ import android.os.Message; import android.os.Messenger; import android.os.RemoteException; import android.os.ServiceManager; import android.telephony.MSimTelephonyManager; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Slog; import com.android.internal.telephony.DctConstants; import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.msim.ITelephonyMSim; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.util.AsyncChannel; Loading @@ -57,6 +62,7 @@ public class MobileDataStateTracker implements NetworkStateTracker { private PhoneConstants.DataState mMobileDataState; private ITelephony mPhoneService; private ITelephonyMSim mMSimPhoneService; private String mApnType; private NetworkInfo mNetworkInfo; Loading Loading @@ -315,6 +321,13 @@ public class MobileDataStateTracker implements NetworkStateTracker { } private void getPhoneService(boolean forceRefresh) { if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { if (mMSimPhoneService == null || forceRefresh) { mMSimPhoneService = ITelephonyMSim.Stub.asInterface( ServiceManager.getService("phone_msim")); } return; } if ((mPhoneService == null) || forceRefresh) { mPhoneService = ITelephony.Stub.asInterface(ServiceManager.getService("phone")); } Loading Loading @@ -343,6 +356,7 @@ public class MobileDataStateTracker implements NetworkStateTracker { networkTypeStr = "edge"; break; case TelephonyManager.NETWORK_TYPE_UMTS: case TelephonyManager.NETWORK_TYPE_TD_SCDMA: networkTypeStr = "umts"; break; case TelephonyManager.NETWORK_TYPE_HSDPA: Loading Loading @@ -498,6 +512,23 @@ public class MobileDataStateTracker implements NetworkStateTracker { * RemoteException and need to re-reference the service. */ for (int retry = 0; retry < 2; retry++) { if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { if (mMSimPhoneService == null) { loge("Ignoring mobile radio request because " + "could not acquire MSim Phone Service"); break; } try { boolean result = true; for (int i = 0; i < MSimTelephonyManager.getDefault().getPhoneCount(); i++) { result = result && mMSimPhoneService.setRadio(turnOn, i); } return result; } catch (RemoteException e) { if (retry == 0) getPhoneService(true); } } else { if (mPhoneService == null) { loge("Ignoring mobile radio request because could not acquire PhoneService"); break; Loading @@ -509,6 +540,7 @@ public class MobileDataStateTracker implements NetworkStateTracker { if (retry == 0) getPhoneService(true); } } } loge("Could not set radio power to " + (turnOn ? "on" : "off")); return false; Loading Loading @@ -637,6 +669,22 @@ public class MobileDataStateTracker implements NetworkStateTracker { * RemoteException and need to re-reference the service. */ for (int retry = 0; retry < 2; retry++) { if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { if (mMSimPhoneService == null) { loge("Ignoring feature request because could not acquire MSim Phone Service"); break; } try { if (enable) { return mMSimPhoneService.enableApnType(apnType); } else { return mMSimPhoneService.disableApnType(apnType); } } catch (RemoteException e) { if (retry == 0) getPhoneService(true); } } else { if (mPhoneService == null) { loge("Ignoring feature request because could not acquire PhoneService"); break; Loading @@ -652,6 +700,7 @@ public class MobileDataStateTracker implements NetworkStateTracker { if (retry == 0) getPhoneService(true); } } } loge("Could not " + (enable ? "enable" : "disable") + " APN type \"" + apnType + "\""); return PhoneConstants.APN_REQUEST_FAILED; Loading
core/java/android/provider/Settings.java +64 −0 Original line number Diff line number Diff line /* * Copyright (C) 2006 The Android Open Source Project * Copyright (c) 2013 The Linux Foundation. All rights reserved. * * Not a Contribution. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -6914,6 +6917,67 @@ public final class Settings { public static boolean putFloat(ContentResolver cr, String name, float value) { return putString(cr, name, Float.toString(value)); } /** * Subscription to be used for voice call on a multi sim device. The supported values * are 0 = SUB1, 1 = SUB2 and etc. * @hide */ public static final String MULTI_SIM_VOICE_CALL_SUBSCRIPTION = "multi_sim_voice_call"; /** * Used to provide option to user to select subscription during dial. * The supported values are 0 = disable or 1 = enable prompt. * @hide */ public static final String MULTI_SIM_VOICE_PROMPT = "multi_sim_voice_prompt"; /** * Subscription to be used for data call on a multi sim device. The supported values * are 0 = SUB1, 1 = SUB2 and etc. * @hide */ public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call"; /** * Subscription to be used for SMS on a multi sim device. The supported values * are 0 = SUB1, 1 = SUB2 and etc. * @hide */ public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms"; /** * Used to provide option to user to select subscription during send SMS. * The value 1 - enable, 0 - disable * @hide */ public static final String MULTI_SIM_SMS_PROMPT = "multi_sim_sms_prompt"; /** User preferred subscriptions setting. * This holds the details of the user selected subscription from the card and * the activation status. Each settings string have the coma separated values * iccId,appType,appId,activationStatus,3gppIndex,3gpp2Index * @hide */ public static final String[] MULTI_SIM_USER_PREFERRED_SUBS = {"user_preferred_sub1", "user_preferred_sub2","user_preferred_sub3"}; /** * Subscription to be used decide priority sub on a multi sim device. The supported values * are 0 = SUB1, 1 = SUB2, 2 = SUB3. * @hide */ public static final String MULTI_SIM_PRIORITY_SUBSCRIPTION = "multi_sim_priority"; /** * To know the status of tune away. The supported values * are false = disable, true = enable. * @hide */ public static final String TUNE_AWAY_STATUS = "tune_away"; } /** Loading