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

Commit c2972400 authored by Cassie Wang's avatar Cassie Wang
Browse files

Switch to Binder.getCallingUid.

Since there are some AppSearch callers from system_server, we don't want
to throw.

Bug: 183986767
Test: presubmit
Change-Id: I4ee3640a71f2f0bc2758a0fb41667c55ef13296c
parent 5c01d600
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -160,7 +160,7 @@ public class AppSearchManagerService extends SystemService {
            Preconditions.checkNotNull(packageName);
            Preconditions.checkNotNull(packageName);
            Preconditions.checkNotNull(databaseName);
            Preconditions.checkNotNull(databaseName);
            Preconditions.checkNotNull(callback);
            Preconditions.checkNotNull(callback);
            int callingUid = Binder.getCallingUidOrThrow();
            int callingUid = Binder.getCallingUid();
            int callingUserId = handleIncomingUser(userId, callingUid);
            int callingUserId = handleIncomingUser(userId, callingUid);
            final long callingIdentity = Binder.clearCallingIdentity();
            final long callingIdentity = Binder.clearCallingIdentity();
            try {
            try {
@@ -187,7 +187,7 @@ public class AppSearchManagerService extends SystemService {
            Preconditions.checkNotNull(packageName);
            Preconditions.checkNotNull(packageName);
            Preconditions.checkNotNull(databaseName);
            Preconditions.checkNotNull(databaseName);
            Preconditions.checkNotNull(callback);
            Preconditions.checkNotNull(callback);
            int callingUid = Binder.getCallingUidOrThrow();
            int callingUid = Binder.getCallingUid();
            int callingUserId = handleIncomingUser(userId, callingUid);
            int callingUserId = handleIncomingUser(userId, callingUid);
            final long callingIdentity = Binder.clearCallingIdentity();
            final long callingIdentity = Binder.clearCallingIdentity();
            try {
            try {
@@ -640,7 +640,7 @@ public class AppSearchManagerService extends SystemService {


        @Override
        @Override
        public void persistToDisk(@UserIdInt int userId) {
        public void persistToDisk(@UserIdInt int userId) {
            int callingUid = Binder.getCallingUidOrThrow();
            int callingUid = Binder.getCallingUid();
            int callingUserId = handleIncomingUser(userId, callingUid);
            int callingUserId = handleIncomingUser(userId, callingUid);
            final long callingIdentity = Binder.clearCallingIdentity();
            final long callingIdentity = Binder.clearCallingIdentity();
            try {
            try {