Loading src/java/com/android/internal/telephony/PhoneSubInfoController.java +14 −15 Original line number Diff line number Diff line Loading @@ -44,16 +44,15 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub { public String getDeviceId() { return getDeviceIdForSubscriber(getDefaultSubscription()); return getDeviceIdForPhone(SubscriptionManager.getPhoneId(getDefaultSubscription())); } public String getDeviceIdForSubscriber(int subId) { PhoneSubInfoProxy phoneSubInfoProxy = getPhoneSubInfoProxy(subId); if (phoneSubInfoProxy != null) { return phoneSubInfoProxy.getDeviceId(); public String getDeviceIdForPhone(int phoneId) { Phone phone = getPhone(phoneId); if (phone != null) { return phone.getDeviceId(); } else { Rlog.e(TAG,"getDeviceId phoneSubInfoProxy is null" + " for Subscription:" + subId); Rlog.e(TAG,"getDeviceIdForPhone phone " + phoneId + " is null"); return null; } } Loading Loading @@ -223,23 +222,23 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub { private PhoneSubInfoProxy getPhoneSubInfoProxy(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); if (phoneId < 0 || phoneId >= TelephonyManager.getDefault().getPhoneCount()) { phoneId = 0; } try { return ((PhoneProxy)mPhone[(int)phoneId]).getPhoneSubInfoProxy(); return getPhone(phoneId).getPhoneSubInfoProxy(); } catch (NullPointerException e) { Rlog.e(TAG, "Exception is :" + e.toString() + " For subId :" + subId); e.printStackTrace(); return null; } catch (ArrayIndexOutOfBoundsException e) { Rlog.e(TAG, "Exception is :" + e.toString() + " For subId :" + subId); e.printStackTrace(); return null; } } private PhoneProxy getPhone(int phoneId) { if (phoneId < 0 || phoneId >= TelephonyManager.getDefault().getPhoneCount()) { phoneId = 0; } return (PhoneProxy) mPhone[phoneId]; } private int getDefaultSubscription() { return PhoneFactory.getDefaultSubscription(); } Loading src/java/com/android/internal/telephony/PhoneSubInfoProxy.java +2 −2 Original line number Diff line number Diff line Loading @@ -152,8 +152,8 @@ public class PhoneSubInfoProxy extends IPhoneSubInfo.Stub { } @Override public String getDeviceIdForSubscriber(int subId) throws RemoteException { // FIXME: getDeviceIdForSubscriber public String getDeviceIdForPhone(int phoneId) throws RemoteException { // FIXME: getDeviceIdForPhone return null; } Loading Loading
src/java/com/android/internal/telephony/PhoneSubInfoController.java +14 −15 Original line number Diff line number Diff line Loading @@ -44,16 +44,15 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub { public String getDeviceId() { return getDeviceIdForSubscriber(getDefaultSubscription()); return getDeviceIdForPhone(SubscriptionManager.getPhoneId(getDefaultSubscription())); } public String getDeviceIdForSubscriber(int subId) { PhoneSubInfoProxy phoneSubInfoProxy = getPhoneSubInfoProxy(subId); if (phoneSubInfoProxy != null) { return phoneSubInfoProxy.getDeviceId(); public String getDeviceIdForPhone(int phoneId) { Phone phone = getPhone(phoneId); if (phone != null) { return phone.getDeviceId(); } else { Rlog.e(TAG,"getDeviceId phoneSubInfoProxy is null" + " for Subscription:" + subId); Rlog.e(TAG,"getDeviceIdForPhone phone " + phoneId + " is null"); return null; } } Loading Loading @@ -223,23 +222,23 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub { private PhoneSubInfoProxy getPhoneSubInfoProxy(int subId) { int phoneId = SubscriptionManager.getPhoneId(subId); if (phoneId < 0 || phoneId >= TelephonyManager.getDefault().getPhoneCount()) { phoneId = 0; } try { return ((PhoneProxy)mPhone[(int)phoneId]).getPhoneSubInfoProxy(); return getPhone(phoneId).getPhoneSubInfoProxy(); } catch (NullPointerException e) { Rlog.e(TAG, "Exception is :" + e.toString() + " For subId :" + subId); e.printStackTrace(); return null; } catch (ArrayIndexOutOfBoundsException e) { Rlog.e(TAG, "Exception is :" + e.toString() + " For subId :" + subId); e.printStackTrace(); return null; } } private PhoneProxy getPhone(int phoneId) { if (phoneId < 0 || phoneId >= TelephonyManager.getDefault().getPhoneCount()) { phoneId = 0; } return (PhoneProxy) mPhone[phoneId]; } private int getDefaultSubscription() { return PhoneFactory.getDefaultSubscription(); } Loading
src/java/com/android/internal/telephony/PhoneSubInfoProxy.java +2 −2 Original line number Diff line number Diff line Loading @@ -152,8 +152,8 @@ public class PhoneSubInfoProxy extends IPhoneSubInfo.Stub { } @Override public String getDeviceIdForSubscriber(int subId) throws RemoteException { // FIXME: getDeviceIdForSubscriber public String getDeviceIdForPhone(int phoneId) throws RemoteException { // FIXME: getDeviceIdForPhone return null; } Loading