I need to use the android.permission.CHANGE_COMPONENT_ENABLED_STATE permission in my code because I need to update the component of another apk of my project, but it really does not work for me.
here is my code:
<permission
android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"
android:protectionLevel="signatureOrSystem"/>
final int permission = ctx.checkCallingPermission(android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE);
final boolean allowedByPermission = (permission == PackageManager.PERMISSION_GRANTED);
L.d(TAG, "allowedByPermission :" + allowedByPermission + " permission:" + permission);
if(allowedByPermission) {}
allowedByPermission always logs false .. not sure if I can skip something?
source
share