I have a system service KioskService. Inside this system service I call another system service DpcService like that:
public class KioskService extends IKioskService.Stub{
private Context mContext;
private IDpcService dpcService;
public KioskService(Context context) {
mContext = context;
}
@Override
public void exitKiosk() {
try{
String[] emptyArray = {""};
dpcService = IDpcService.Stub.asInterface(getBinder("dpc"));
dpcService.setLockTaskPackages(emptyArray);
}
catch(Exception e){
Log.e("TAG","Exit Kiosk Exception",e);
}
}
private IBinder getBinder(String serviceName) {
IBinder serviceBinder;
serviceBinder = ServiceManager.getService(serviceName);
if (serviceBinder == null) {
return null;
}
return serviceBinder;
}
}
However I get this error:
05-06 06:40:00.088 604 604 E SELinux : avc: denied { find } for service=msi_dpc pid=5375 uid=1000 scontext=u:r:kiosk_app:s0 tcontext=u:object_r:dpc_service:s0 tclass=service_manager permissive=0
I guess, the reason is because, using Selinux policy, I have to allow my kiosk service to use my dpc service. If it is the case how do I do it?