Set radio power of all phones and multi phone changes.
bug:18415518
Change-Id: I33845aec1e7f162430b76ce0dee4d10664722bdd
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 0c8b62c..502a379 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -51,9 +51,11 @@
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
+import com.android.internal.telephony.IccCard;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
+import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.TelephonyCapabilities;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.sip.SipPhone;
@@ -2450,4 +2452,28 @@
String id = isEmergency ? "E" : prefix + String.valueOf(phone.getSubId());
return new PhoneAccountHandle(pstnConnectionServiceName, id);
}
+
+ /**
+ * Register ICC status for all phones.
+ */
+ static final void registerIccStatus(Handler handler, int event) {
+ for (Phone phone : PhoneFactory.getPhones()) {
+ IccCard sim = phone.getIccCard();
+ if (sim != null) {
+ if (VDBG) Log.v(LOG_TAG, "register for ICC status, phone " + phone.getPhoneId());
+ sim.registerForNetworkLocked(handler, event, phone);
+ }
+ }
+ }
+
+ /**
+ * Set the radio power on/off state for all phones.
+ *
+ * @param enabled true means on, false means off.
+ */
+ static final void setRadioPower(boolean enabled) {
+ for (Phone phone : PhoneFactory.getPhones()) {
+ phone.setRadioPower(enabled);
+ }
+ }
}