Loading src/java/com/android/internal/telephony/ModemStackController.java +17 −0 Original line number Diff line number Diff line Loading @@ -200,6 +200,22 @@ public class ModemStackController extends Handler { sendMessage(msg); } } } else if (TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT. equals(intent.getAction())) { long subId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.INVALID_SUB_ID); int phoneId = intent.getIntExtra(PhoneConstants.PHONE_KEY, PhoneConstants.PHONE_ID1); int status = intent.getIntExtra(TelephonyIntents.EXTRA_RESULT, PhoneConstants.FAILURE); logd("Received ACTION_SUBSCRIPTION_SET_UICC_RESULT on subId: " + subId + "phoneId " + phoneId + " status: " + status); if (mDeactivationInProgress && (status == PhoneConstants.FAILURE)) { // Sub deactivation failed Message msg = obtainMessage(EVENT_SUB_DEACTIVATED, new Integer(phoneId)); AsyncResult.forMessage(msg, SubscriptionStatus.SUB_ACTIVATED, null); sendMessage(msg); } } }}; Loading Loading @@ -250,6 +266,7 @@ public class ModemStackController extends Handler { IntentFilter filter = new IntentFilter(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED); filter.addAction(TelephonyIntents.ACTION_SUBINFO_CONTENT_CHANGE); filter.addAction(TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT); mContext.registerReceiver(mReceiver, filter); logd("Constructor - Exit"); } Loading src/java/com/android/internal/telephony/SubscriptionController.java +22 −12 Original line number Diff line number Diff line Loading @@ -1255,33 +1255,44 @@ public class SubscriptionController extends ISub.Stub { } private void updateDataSubId(long subId) { logd(" updateDataSubId, subId=" + subId); Settings.Global.putLong(mContext.getContentResolver(), Settings.Global.MULTI_SIM_DATA_CALL_SUBSCRIPTION, subId); private void updateDataSubId(AsyncResult ar) { Long subId = (Long)ar.result; int reqStatus = PhoneConstants.FAILURE; logd(" updateDataSubId, subId=" + subId + " exception " + ar.exception); // Update newDds in database if the DDS request succeeded. if (ar.exception == null) { setDataSubId(subId); reqStatus = PhoneConstants.SUCCESS; } mScheduler.updateCurrentDds(null); broadcastDefaultDataSubIdChanged(subId); broadcastDefaultDataSubIdChanged(reqStatus); // FIXME is this still needed? updateAllDataConnectionTrackers(); } public void setDataSubId(long subId) { Settings.Global.putLong(mContext.getContentResolver(), Settings.Global.MULTI_SIM_DATA_CALL_SUBSCRIPTION, subId); } private void updateAllDataConnectionTrackers() { // Tell Phone Proxies to update data connection tracker int len = sProxyPhones.length; logdl("[updateAllDataConnectionTrackers] sProxyPhones.length=" + len); for (int phoneId = 0; phoneId < len; phoneId++) { logdl("[updateAllDataConnectionTrackers] phoneId=" + phoneId); sProxyPhones[phoneId].updateDataConnectionTracker(); } } private void broadcastDefaultDataSubIdChanged(long subId) { private void broadcastDefaultDataSubIdChanged(int status) { // Broadcast an Intent for default data sub change logdl("[broadcastDefaultDataSubIdChanged] subId=" + subId); logdl("[broadcastDefaultDataSubIdChanged] subId = " + getDefaultDataSubId() + " status " + status); Intent intent = new Intent(TelephonyIntents.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, getDefaultDataSubId()); intent.putExtra(TelephonyIntents.EXTRA_RESULT, status); mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL); } Loading Loading @@ -1368,9 +1379,8 @@ public class SubscriptionController extends ISub.Stub { switch (msg.what) { case EVENT_SET_DEFAULT_DATA_DONE:{ AsyncResult ar = (AsyncResult) msg.obj; Long subId = (Long)ar.result; logd("EVENT_SET_DEFAULT_DATA_DONE subId:" + subId); updateDataSubId(subId); logd("EVENT_SET_DEFAULT_DATA_DONE subId:" + (Long)ar.result); updateDataSubId(ar); break; } } Loading src/java/com/android/internal/telephony/SubscriptionHelper.java +24 −9 Original line number Diff line number Diff line Loading @@ -33,12 +33,14 @@ package com.android.internal.telephony; import android.telephony.Rlog; import android.content.Context; import android.content.Intent; import android.database.ContentObserver; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; import android.os.AsyncResult; import android.os.Handler; import android.os.Message; import android.os.UserHandle; import android.os.SystemProperties; import android.telephony.TelephonyManager; import android.telephony.SubscriptionManager; Loading @@ -65,6 +67,7 @@ class SubscriptionHelper extends Handler { private static final int EVENT_SET_UICC_SUBSCRIPTION_DONE = 1; public static final int SUB_SET_UICC_FAIL = -100; public static final int SUB_SIM_NOT_INSERTED = -99; public static final int SUB_INIT_STATE = -1; private static boolean mNwModeUpdated = false; Loading Loading @@ -233,24 +236,26 @@ class SubscriptionHelper extends Handler { * @param ar */ private void processSetUiccSubscriptionDone(Message msg) { SubscriptionController subCtrlr = SubscriptionController.getInstance(); AsyncResult ar = (AsyncResult)msg.obj; int slotId = msg.arg1; int newSubState = msg.arg2; long[] subId = subCtrlr.getSubIdUsingSlotId(slotId); if (ar.exception != null) { logd("Exception in SET_UICC_SUBSCRIPTION, slotId = " + slotId); loge("Exception in SET_UICC_SUBSCRIPTION, slotId = " + slotId + " newSubState " + newSubState); // broadcast set uicc failure mSubStatus[slotId] = SUB_SET_UICC_FAIL; broadcastSetUiccResult(slotId, newSubState, PhoneConstants.FAILURE); return; } SubscriptionController subCtrlr = SubscriptionController.getInstance(); if (subCtrlr != null) { long[] subId = subCtrlr.getSubIdUsingSlotId(slotId); int subStatus = subCtrlr.getSubState(subId[0]); if (newSubState != subStatus) { subCtrlr.setSubState(subId[0], newSubState); } } broadcastSetUiccResult(slotId, newSubState, PhoneConstants.SUCCESS); mSubStatus[slotId] = newSubState; // After activating all subs, updated the user preferred sub values Loading @@ -262,6 +267,16 @@ class SubscriptionHelper extends Handler { } } private void broadcastSetUiccResult(int slotId, int newSubState, int result) { long[] subId = SubscriptionController.getInstance().getSubIdUsingSlotId(slotId); Intent intent = new Intent(TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); SubscriptionManager.putPhoneIdAndSubIdExtra(intent, slotId, subId[0]); intent.putExtra(TelephonyIntents.EXTRA_RESULT, result); intent.putExtra(TelephonyIntents.EXTRA_NEW_SUB_STATE, newSubState); mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL); } private boolean isAllSubsAvailable() { boolean allSubsAvailable = true; Loading src/java/com/android/internal/telephony/dataconnection/DctController.java +3 −4 Original line number Diff line number Diff line Loading @@ -518,8 +518,7 @@ public class DctController extends Handler { // This generally happens when device power-up first time. logd(" setDefaultDataSubId, reqSubId = " + reqSubId + " currentDdsPhoneId " + currentDdsPhoneId); Settings.Global.putLong(mContext.getContentResolver(), Settings.Global.MULTI_SIM_DATA_CALL_SUBSCRIPTION, reqSubId); mSubController.setDataSubId(reqSubId); defaultDds = reqSubId; currentDdsPhoneId = mSubController.getPhoneId(defaultDds); } Loading Loading
src/java/com/android/internal/telephony/ModemStackController.java +17 −0 Original line number Diff line number Diff line Loading @@ -200,6 +200,22 @@ public class ModemStackController extends Handler { sendMessage(msg); } } } else if (TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT. equals(intent.getAction())) { long subId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.INVALID_SUB_ID); int phoneId = intent.getIntExtra(PhoneConstants.PHONE_KEY, PhoneConstants.PHONE_ID1); int status = intent.getIntExtra(TelephonyIntents.EXTRA_RESULT, PhoneConstants.FAILURE); logd("Received ACTION_SUBSCRIPTION_SET_UICC_RESULT on subId: " + subId + "phoneId " + phoneId + " status: " + status); if (mDeactivationInProgress && (status == PhoneConstants.FAILURE)) { // Sub deactivation failed Message msg = obtainMessage(EVENT_SUB_DEACTIVATED, new Integer(phoneId)); AsyncResult.forMessage(msg, SubscriptionStatus.SUB_ACTIVATED, null); sendMessage(msg); } } }}; Loading Loading @@ -250,6 +266,7 @@ public class ModemStackController extends Handler { IntentFilter filter = new IntentFilter(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED); filter.addAction(TelephonyIntents.ACTION_SUBINFO_CONTENT_CHANGE); filter.addAction(TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT); mContext.registerReceiver(mReceiver, filter); logd("Constructor - Exit"); } Loading
src/java/com/android/internal/telephony/SubscriptionController.java +22 −12 Original line number Diff line number Diff line Loading @@ -1255,33 +1255,44 @@ public class SubscriptionController extends ISub.Stub { } private void updateDataSubId(long subId) { logd(" updateDataSubId, subId=" + subId); Settings.Global.putLong(mContext.getContentResolver(), Settings.Global.MULTI_SIM_DATA_CALL_SUBSCRIPTION, subId); private void updateDataSubId(AsyncResult ar) { Long subId = (Long)ar.result; int reqStatus = PhoneConstants.FAILURE; logd(" updateDataSubId, subId=" + subId + " exception " + ar.exception); // Update newDds in database if the DDS request succeeded. if (ar.exception == null) { setDataSubId(subId); reqStatus = PhoneConstants.SUCCESS; } mScheduler.updateCurrentDds(null); broadcastDefaultDataSubIdChanged(subId); broadcastDefaultDataSubIdChanged(reqStatus); // FIXME is this still needed? updateAllDataConnectionTrackers(); } public void setDataSubId(long subId) { Settings.Global.putLong(mContext.getContentResolver(), Settings.Global.MULTI_SIM_DATA_CALL_SUBSCRIPTION, subId); } private void updateAllDataConnectionTrackers() { // Tell Phone Proxies to update data connection tracker int len = sProxyPhones.length; logdl("[updateAllDataConnectionTrackers] sProxyPhones.length=" + len); for (int phoneId = 0; phoneId < len; phoneId++) { logdl("[updateAllDataConnectionTrackers] phoneId=" + phoneId); sProxyPhones[phoneId].updateDataConnectionTracker(); } } private void broadcastDefaultDataSubIdChanged(long subId) { private void broadcastDefaultDataSubIdChanged(int status) { // Broadcast an Intent for default data sub change logdl("[broadcastDefaultDataSubIdChanged] subId=" + subId); logdl("[broadcastDefaultDataSubIdChanged] subId = " + getDefaultDataSubId() + " status " + status); Intent intent = new Intent(TelephonyIntents.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, getDefaultDataSubId()); intent.putExtra(TelephonyIntents.EXTRA_RESULT, status); mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL); } Loading Loading @@ -1368,9 +1379,8 @@ public class SubscriptionController extends ISub.Stub { switch (msg.what) { case EVENT_SET_DEFAULT_DATA_DONE:{ AsyncResult ar = (AsyncResult) msg.obj; Long subId = (Long)ar.result; logd("EVENT_SET_DEFAULT_DATA_DONE subId:" + subId); updateDataSubId(subId); logd("EVENT_SET_DEFAULT_DATA_DONE subId:" + (Long)ar.result); updateDataSubId(ar); break; } } Loading
src/java/com/android/internal/telephony/SubscriptionHelper.java +24 −9 Original line number Diff line number Diff line Loading @@ -33,12 +33,14 @@ package com.android.internal.telephony; import android.telephony.Rlog; import android.content.Context; import android.content.Intent; import android.database.ContentObserver; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; import android.os.AsyncResult; import android.os.Handler; import android.os.Message; import android.os.UserHandle; import android.os.SystemProperties; import android.telephony.TelephonyManager; import android.telephony.SubscriptionManager; Loading @@ -65,6 +67,7 @@ class SubscriptionHelper extends Handler { private static final int EVENT_SET_UICC_SUBSCRIPTION_DONE = 1; public static final int SUB_SET_UICC_FAIL = -100; public static final int SUB_SIM_NOT_INSERTED = -99; public static final int SUB_INIT_STATE = -1; private static boolean mNwModeUpdated = false; Loading Loading @@ -233,24 +236,26 @@ class SubscriptionHelper extends Handler { * @param ar */ private void processSetUiccSubscriptionDone(Message msg) { SubscriptionController subCtrlr = SubscriptionController.getInstance(); AsyncResult ar = (AsyncResult)msg.obj; int slotId = msg.arg1; int newSubState = msg.arg2; long[] subId = subCtrlr.getSubIdUsingSlotId(slotId); if (ar.exception != null) { logd("Exception in SET_UICC_SUBSCRIPTION, slotId = " + slotId); loge("Exception in SET_UICC_SUBSCRIPTION, slotId = " + slotId + " newSubState " + newSubState); // broadcast set uicc failure mSubStatus[slotId] = SUB_SET_UICC_FAIL; broadcastSetUiccResult(slotId, newSubState, PhoneConstants.FAILURE); return; } SubscriptionController subCtrlr = SubscriptionController.getInstance(); if (subCtrlr != null) { long[] subId = subCtrlr.getSubIdUsingSlotId(slotId); int subStatus = subCtrlr.getSubState(subId[0]); if (newSubState != subStatus) { subCtrlr.setSubState(subId[0], newSubState); } } broadcastSetUiccResult(slotId, newSubState, PhoneConstants.SUCCESS); mSubStatus[slotId] = newSubState; // After activating all subs, updated the user preferred sub values Loading @@ -262,6 +267,16 @@ class SubscriptionHelper extends Handler { } } private void broadcastSetUiccResult(int slotId, int newSubState, int result) { long[] subId = SubscriptionController.getInstance().getSubIdUsingSlotId(slotId); Intent intent = new Intent(TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); SubscriptionManager.putPhoneIdAndSubIdExtra(intent, slotId, subId[0]); intent.putExtra(TelephonyIntents.EXTRA_RESULT, result); intent.putExtra(TelephonyIntents.EXTRA_NEW_SUB_STATE, newSubState); mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL); } private boolean isAllSubsAvailable() { boolean allSubsAvailable = true; Loading
src/java/com/android/internal/telephony/dataconnection/DctController.java +3 −4 Original line number Diff line number Diff line Loading @@ -518,8 +518,7 @@ public class DctController extends Handler { // This generally happens when device power-up first time. logd(" setDefaultDataSubId, reqSubId = " + reqSubId + " currentDdsPhoneId " + currentDdsPhoneId); Settings.Global.putLong(mContext.getContentResolver(), Settings.Global.MULTI_SIM_DATA_CALL_SUBSCRIPTION, reqSubId); mSubController.setDataSubId(reqSubId); defaultDds = reqSubId; currentDdsPhoneId = mSubController.getPhoneId(defaultDds); } Loading