Merge "Apply radio ON/OFF commands to all Phones" into main
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index e03958e..6c5e916 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -3021,14 +3021,15 @@
+ ",reason=" + reason + ",callingPackage=" + getCurrentPackageName());
final long identity = Binder.clearCallingIdentity();
try {
- final Phone phone = getPhoneFromSubIdOrDefault(subId);
- if (phone != null) {
+ boolean result = false;
+ for (Phone phone : PhoneFactory.getPhones()) {
+ result = true;
phone.setRadioPowerForReason(false, reason);
- return true;
- } else {
- loge("requestRadioPowerOffForReason: phone is null");
- return false;
}
+ if (!result) {
+ loge("requestRadioPowerOffForReason: no phone exists");
+ }
+ return result;
} finally {
Binder.restoreCallingIdentity(identity);
}
@@ -3048,14 +3049,15 @@
final long identity = Binder.clearCallingIdentity();
try {
- final Phone phone = getPhoneFromSubIdOrDefault(subId);
- if (phone != null) {
+ boolean result = false;
+ for (Phone phone : PhoneFactory.getPhones()) {
+ result = true;
phone.setRadioPowerForReason(true, reason);
- return true;
- } else {
- loge("clearRadioPowerOffForReason: phone is null");
- return false;
}
+ if (!result) {
+ loge("clearRadioPowerOffForReason: no phone exists");
+ }
+ return result;
} finally {
Binder.restoreCallingIdentity(identity);
}