Directly invoke the default phone's method in setRadioPower()
In the original implementation, SubscriptionController.getDefaultSubId()
doesn't return the correct value on boot.
b/30552536
Change-Id: Ic0a6556eaa3a1a832ba7140814ad8354b995a853
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 9b7132b..d857087 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1403,7 +1403,14 @@
}
public boolean setRadioPower(boolean turnOn) {
- return setRadioPowerForSubscriber(getDefaultSubscription(), turnOn);
+ final Phone defaultPhone = PhoneFactory.getDefaultPhone();
+ if (defaultPhone != null) {
+ defaultPhone.setRadioPower(turnOn);
+ return true;
+ } else {
+ loge("There's no default phone.");
+ return false;
+ }
}
public boolean setRadioPowerForSubscriber(int subId, boolean turnOn) {