cmsdk: Reimplement helper methods for secondary telephony service.
Change-Id: If126936f788d398c53dca21297cd7d69f9d933b8
This commit is contained in:
parent
c221959167
commit
4ae9604b18
|
@ -201,10 +201,11 @@ public class CMTelephonyManagerService extends SystemService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSubActive(int subId) {
|
private boolean isSubActive(int subId) {
|
||||||
/* boolean validSubscriptionId = SubscriptionManager.isValidSubscriptionId(subId);
|
boolean validSubscriptionId = SubscriptionManager.isValidSubscriptionId(subId);
|
||||||
|
|
||||||
if (validSubscriptionId) {
|
if (validSubscriptionId) {
|
||||||
int simState = SubscriptionManager.getSimStateForSubscriber(subId);
|
int simState = SubscriptionManager.getSimStateForSlotIdx(
|
||||||
|
SubscriptionManager.getSlotId(subId));
|
||||||
switch (simState) {
|
switch (simState) {
|
||||||
case TelephonyManager.SIM_STATE_ABSENT:
|
case TelephonyManager.SIM_STATE_ABSENT:
|
||||||
case TelephonyManager.SIM_STATE_CARD_IO_ERROR:
|
case TelephonyManager.SIM_STATE_CARD_IO_ERROR:
|
||||||
|
@ -223,12 +224,11 @@ public class CMTelephonyManagerService extends SystemService {
|
||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "Invalid subscription identifier: " + subId);
|
Log.w(TAG, "Invalid subscription identifier: " + subId);
|
||||||
return false;
|
return false;
|
||||||
} */
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSubState(int subId, boolean state) {
|
private void setSubState(int subId, boolean state) {
|
||||||
/* if (localLOGD) {
|
if (localLOGD) {
|
||||||
Log.d(TAG, "Setting the subscription " + subId + " to inactive (false) or active (true): " + state);
|
Log.d(TAG, "Setting the subscription " + subId + " to inactive (false) or active (true): " + state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ public class CMTelephonyManagerService extends SystemService {
|
||||||
SubscriptionManager.activateSubId(subId);
|
SubscriptionManager.activateSubId(subId);
|
||||||
} else {
|
} else {
|
||||||
SubscriptionManager.deactivateSubId(subId);
|
SubscriptionManager.deactivateSubId(subId);
|
||||||
} */
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isDataConnectionSelectedOnSub(int subId) {
|
private boolean isDataConnectionSelectedOnSub(int subId) {
|
||||||
|
@ -296,12 +296,12 @@ public class CMTelephonyManagerService extends SystemService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDefaultPhoneSub(int subId) {
|
private void setDefaultPhoneSub(int subId) {
|
||||||
/* if (localLOGD) {
|
if (localLOGD) {
|
||||||
Log.d(TAG, "Setting the SIM for phone calls on subscription " + subId);
|
Log.d(TAG, "Setting the SIM for phone calls on subscription " + subId);
|
||||||
}
|
}
|
||||||
|
|
||||||
SubscriptionManager subscriptionManager = SubscriptionManager.from(mContext);
|
SubscriptionManager subscriptionManager = SubscriptionManager.from(mContext);
|
||||||
if (subId == CMTelephonyManager.ASK_FOR_SUBSCRIPTION_ID) {
|
/*if (subId == CMTelephonyManager.ASK_FOR_SUBSCRIPTION_ID) {
|
||||||
if (localLOGD) {
|
if (localLOGD) {
|
||||||
Log.d(TAG, "Activates the prompt for phone calls");
|
Log.d(TAG, "Activates the prompt for phone calls");
|
||||||
}
|
}
|
||||||
|
@ -309,16 +309,17 @@ public class CMTelephonyManagerService extends SystemService {
|
||||||
} else {
|
} else {
|
||||||
SubscriptionManager.setVoicePromptEnabled(false);
|
SubscriptionManager.setVoicePromptEnabled(false);
|
||||||
subscriptionManager.setDefaultVoiceSubId(subId);
|
subscriptionManager.setDefaultVoiceSubId(subId);
|
||||||
} */
|
}*/
|
||||||
|
subscriptionManager.setDefaultVoiceSubId(subId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDefaultSmsSub(int subId) {
|
private void setDefaultSmsSub(int subId) {
|
||||||
/* if (localLOGD) {
|
if (localLOGD) {
|
||||||
Log.d(TAG, "Setting the SIM for phone calls on subscription " + subId);
|
Log.d(TAG, "Setting the SIM for phone calls on subscription " + subId);
|
||||||
}
|
}
|
||||||
|
|
||||||
SubscriptionManager subscriptionManager = SubscriptionManager.from(mContext);
|
SubscriptionManager subscriptionManager = SubscriptionManager.from(mContext);
|
||||||
if (subId == CMTelephonyManager.ASK_FOR_SUBSCRIPTION_ID) {
|
/*if (subId == CMTelephonyManager.ASK_FOR_SUBSCRIPTION_ID) {
|
||||||
if (localLOGD) {
|
if (localLOGD) {
|
||||||
Log.d(TAG, "Activates the prompt for SMS");
|
Log.d(TAG, "Activates the prompt for SMS");
|
||||||
}
|
}
|
||||||
|
@ -326,7 +327,8 @@ public class CMTelephonyManagerService extends SystemService {
|
||||||
} else {
|
} else {
|
||||||
SubscriptionManager.setSMSPromptEnabled(false);
|
SubscriptionManager.setSMSPromptEnabled(false);
|
||||||
subscriptionManager.setDefaultSmsSubId(subId);
|
subscriptionManager.setDefaultSmsSubId(subId);
|
||||||
} */
|
}*/
|
||||||
|
subscriptionManager.setDefaultSmsSubId(subId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enforceTelephonyReadPermission() {
|
private void enforceTelephonyReadPermission() {
|
||||||
|
|
Loading…
Reference in New Issue