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

Commit 77421820 authored by Shashwat Razdan's avatar Shashwat Razdan Committed by Android (Google) Code Review
Browse files

Merge "Guarding ACCESS_SMARTSPACE with a flag" into main

parents e9b6f849 0931f1f0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -6,3 +6,10 @@ flag {
  description: "Flag to enable the FlaggedApi to include RemoteViews in SmartspaceTarget"
  bug: "300157758"
}

flag {
  name: "access_smartspace"
  namespace: "sysui_integrations"
  description: "Flag to enable the ACCESS_SMARTSPACE check in SmartspaceManagerService"
  bug: "297207196"
}
+3 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.app.smartspace.ISmartspaceManager;
import android.app.smartspace.SmartspaceConfig;
import android.app.smartspace.SmartspaceSessionId;
import android.app.smartspace.SmartspaceTargetEvent;
import android.app.smartspace.flags.Flags;
import android.content.Context;
import android.os.Binder;
import android.os.IBinder;
@@ -165,7 +166,8 @@ public class SmartspaceManagerService extends
            }
            Context ctx = getContext();
            if (!(ctx.checkCallingPermission(MANAGE_SMARTSPACE) == PERMISSION_GRANTED
                    || ctx.checkCallingPermission(ACCESS_SMARTSPACE) == PERMISSION_GRANTED
                    || (Flags.accessSmartspace()
                    && ctx.checkCallingPermission(ACCESS_SMARTSPACE) == PERMISSION_GRANTED)
                    || mServiceNameResolver.isTemporary(userId)
                    || mActivityTaskManagerInternal.isCallerRecents(Binder.getCallingUid()))) {