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

Commit 54917317 authored by Jackal Guo's avatar Jackal Guo Committed by Android (Google) Code Review
Browse files

Merge "Enforce the calling identity"

parents fdfeb135 fcc515e3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1209,6 +1209,7 @@ public class DomainVerificationService extends SystemService
    public void printOwnersForPackage(@NonNull IndentingPrintWriter writer,
            @Nullable String packageName, @Nullable @UserIdInt Integer userId)
            throws NameNotFoundException {
        mEnforcer.assertApprovedQuerent(mConnection.getCallingUid(), mProxy);
        final Computer snapshot = mConnection.snapshot();
        synchronized (mLock) {
            if (packageName == null) {
@@ -1257,6 +1258,7 @@ public class DomainVerificationService extends SystemService
    @Override
    public void printOwnersForDomains(@NonNull IndentingPrintWriter writer,
            @NonNull List<String> domains, @Nullable @UserIdInt Integer userId) {
        mEnforcer.assertApprovedQuerent(mConnection.getCallingUid(), mProxy);
        final Computer snapshot = mConnection.snapshot();
        synchronized (mLock) {
            int size = domains.size();
+14 −0
Original line number Diff line number Diff line
@@ -219,6 +219,20 @@ class DomainVerificationEnforcerTest {
                    printState(mock(Computer::class.java), mock(IndentingPrintWriter::class.java),
                        null, null)
                },
                service(Type.QUERENT, "printOwnersForPackage") {
                    printOwnersForPackage(
                        mock(IndentingPrintWriter::class.java),
                        it.targetPackageName,
                        it.userId
                    )
                },
                service(Type.QUERENT, "printOwnersForDomains") {
                    printOwnersForDomains(
                        mock(IndentingPrintWriter::class.java),
                        listOf("example.com"),
                        it.userId
                    )
                },
                service(Type.VERIFIER, "setStatus") {
                    setDomainVerificationStatus(
                        it.targetDomainSetId,