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

Commit 0931f1f0 authored by Shashwat Razdan's avatar Shashwat Razdan
Browse files

Guarding ACCESS_SMARTSPACE with a flag

Test: Permission only change
Bug: 297207196
Bug: 304478692
Change-Id: I8ec0c80e1ad364c0b6bb1b966737045a8fe71679
parent c88b5c67
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -6,3 +6,10 @@ flag {
  description: "Flag to enable the FlaggedApi to include RemoteViews in SmartspaceTarget"
  description: "Flag to enable the FlaggedApi to include RemoteViews in SmartspaceTarget"
  bug: "300157758"
  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 Original line Diff line number Diff line
@@ -31,6 +31,7 @@ import android.app.smartspace.ISmartspaceManager;
import android.app.smartspace.SmartspaceConfig;
import android.app.smartspace.SmartspaceConfig;
import android.app.smartspace.SmartspaceSessionId;
import android.app.smartspace.SmartspaceSessionId;
import android.app.smartspace.SmartspaceTargetEvent;
import android.app.smartspace.SmartspaceTargetEvent;
import android.app.smartspace.flags.Flags;
import android.content.Context;
import android.content.Context;
import android.os.Binder;
import android.os.Binder;
import android.os.IBinder;
import android.os.IBinder;
@@ -165,7 +166,8 @@ public class SmartspaceManagerService extends
            }
            }
            Context ctx = getContext();
            Context ctx = getContext();
            if (!(ctx.checkCallingPermission(MANAGE_SMARTSPACE) == PERMISSION_GRANTED
            if (!(ctx.checkCallingPermission(MANAGE_SMARTSPACE) == PERMISSION_GRANTED
                    || ctx.checkCallingPermission(ACCESS_SMARTSPACE) == PERMISSION_GRANTED
                    || (Flags.accessSmartspace()
                    && ctx.checkCallingPermission(ACCESS_SMARTSPACE) == PERMISSION_GRANTED)
                    || mServiceNameResolver.isTemporary(userId)
                    || mServiceNameResolver.isTemporary(userId)
                    || mActivityTaskManagerInternal.isCallerRecents(Binder.getCallingUid()))) {
                    || mActivityTaskManagerInternal.isCallerRecents(Binder.getCallingUid()))) {