Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c28f2602 authored by Nancy Chen's avatar Nancy Chen
Browse files

Adn queries for multi-SIM. (3/3)

Process Telecom method to take in a subscription account and
return the URI for an ADN query for that account.

Bug: 17917937

Change-Id: Idedbe1c6fc63d21c7673c50c1d7894ba981d27ea
parent 4ffff831
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
@@ -482,6 +483,26 @@ public class TelecomServiceImpl extends ITelecomService.Stub {
        return retval;
    }

    /**
     * @see android.telecom.TelecomManager#getAdnUriForPhoneAccount
     */
    @Override
    public Uri getAdnUriForPhoneAccount(PhoneAccountHandle accountHandle) {
        enforceModifyPermissionOrDefaultDialer();

        // Switch identity so that TelephonyManager checks Telecom's permissions instead.
        long token = Binder.clearCallingIdentity();
        String retval = "content://icc/adn/";
        try {
            long subId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle);
            retval = retval + "subId/" + subId;
        } finally {
            Binder.restoreCallingIdentity(token);
        }

        return Uri.parse(retval);
    }

    /**
     * @see android.telecom.TelecomManager#isTtySupported
     */