Loading src/com/android/server/telecom/TelecomService.java +27 −6 Original line number Diff line number Diff line Loading @@ -443,13 +443,24 @@ public class TelecomService extends Service { public boolean hasVoiceMailNumber(PhoneAccountHandle accountHandle) { enforceReadPermissionOrDefaultDialer(); try { if (!isVisibleToCaller(accountHandle)) { Log.w(this, "%s is not visible for the calling user", accountHandle); return false; return !TextUtils.isEmpty(getVoiceMailNumberInternal(accountHandle)); } catch (Exception e) { Log.e(this, e, "getSubscriptionIdForPhoneAccount"); throw e; } } int subId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle); return !TextUtils.isEmpty(getTelephonyManager().getVoiceMailNumber(subId)); /** * @see android.telecom.TelecomManager#getVoiceMailNumber */ @Override public String getVoiceMailNumber(PhoneAccountHandle accountHandle) { if (!isCallerSystemApp()) { throw new SecurityException( "Only system apps are allowed to call getVoiceMailNumber()"); } try { return getVoiceMailNumberInternal(accountHandle); } catch (Exception e) { Log.e(this, e, "getSubscriptionIdForPhoneAccount"); throw e; Loading Loading @@ -744,6 +755,16 @@ public class TelecomService extends Service { // Supporting methods for the ITelecomService interface implementation. // private String getVoiceMailNumberInternal(PhoneAccountHandle accountHandle) { if (!isVisibleToCaller(accountHandle)) { Log.w(this, "%s is not visible for the calling user", accountHandle); return null; } int subId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle); return getTelephonyManager().getVoiceMailNumber(subId); } private boolean isVisibleToCaller(PhoneAccountHandle accountHandle) { if (accountHandle == null) { return false; Loading Loading
src/com/android/server/telecom/TelecomService.java +27 −6 Original line number Diff line number Diff line Loading @@ -443,13 +443,24 @@ public class TelecomService extends Service { public boolean hasVoiceMailNumber(PhoneAccountHandle accountHandle) { enforceReadPermissionOrDefaultDialer(); try { if (!isVisibleToCaller(accountHandle)) { Log.w(this, "%s is not visible for the calling user", accountHandle); return false; return !TextUtils.isEmpty(getVoiceMailNumberInternal(accountHandle)); } catch (Exception e) { Log.e(this, e, "getSubscriptionIdForPhoneAccount"); throw e; } } int subId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle); return !TextUtils.isEmpty(getTelephonyManager().getVoiceMailNumber(subId)); /** * @see android.telecom.TelecomManager#getVoiceMailNumber */ @Override public String getVoiceMailNumber(PhoneAccountHandle accountHandle) { if (!isCallerSystemApp()) { throw new SecurityException( "Only system apps are allowed to call getVoiceMailNumber()"); } try { return getVoiceMailNumberInternal(accountHandle); } catch (Exception e) { Log.e(this, e, "getSubscriptionIdForPhoneAccount"); throw e; Loading Loading @@ -744,6 +755,16 @@ public class TelecomService extends Service { // Supporting methods for the ITelecomService interface implementation. // private String getVoiceMailNumberInternal(PhoneAccountHandle accountHandle) { if (!isVisibleToCaller(accountHandle)) { Log.w(this, "%s is not visible for the calling user", accountHandle); return null; } int subId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle); return getTelephonyManager().getVoiceMailNumber(subId); } private boolean isVisibleToCaller(PhoneAccountHandle accountHandle) { if (accountHandle == null) { return false; Loading