use of android.os.IPermissionController in project android_frameworks_base by ParanoidAndroid.
the class ServiceManagerPermissionTests method testSetPermissionController.
@SmallTest
public void testSetPermissionController() {
try {
IPermissionController pc = new IPermissionController.Stub() {
public boolean checkPermission(java.lang.String permission, int pid, int uid) {
return true;
}
};
ServiceManagerNative.asInterface(BinderInternal.getContextObject()).setPermissionController(pc);
fail("IServiceManager.setPermissionController did not throw SecurityException as" + " expected");
} catch (SecurityException e) {
// expected
} catch (RemoteException e) {
fail("Unexpected remote exception");
}
}
use of android.os.IPermissionController in project android_frameworks_base by ResurrectionRemix.
the class ServiceManagerPermissionTests method testSetPermissionController.
@SmallTest
public void testSetPermissionController() {
try {
IPermissionController pc = new IPermissionController.Stub() {
public boolean checkPermission(java.lang.String permission, int pid, int uid) {
return true;
}
@Override
public String[] getPackagesForUid(int uid) {
return new String[0];
}
@Override
public boolean isRuntimePermission(String permission) {
return false;
}
};
ServiceManagerNative.asInterface(BinderInternal.getContextObject()).setPermissionController(pc);
fail("IServiceManager.setPermissionController did not throw SecurityException as" + " expected");
} catch (SecurityException e) {
// expected
} catch (RemoteException e) {
fail("Unexpected remote exception");
}
}
use of android.os.IPermissionController in project android_frameworks_base by DirtyUnicorns.
the class ServiceManagerPermissionTests method testSetPermissionController.
@SmallTest
public void testSetPermissionController() {
try {
IPermissionController pc = new IPermissionController.Stub() {
public boolean checkPermission(java.lang.String permission, int pid, int uid) {
return true;
}
@Override
public String[] getPackagesForUid(int uid) {
return new String[0];
}
@Override
public boolean isRuntimePermission(String permission) {
return false;
}
};
ServiceManagerNative.asInterface(BinderInternal.getContextObject()).setPermissionController(pc);
fail("IServiceManager.setPermissionController did not throw SecurityException as" + " expected");
} catch (SecurityException e) {
// expected
} catch (RemoteException e) {
fail("Unexpected remote exception");
}
}
use of android.os.IPermissionController in project android_frameworks_base by crdroidandroid.
the class ServiceManagerPermissionTests method testSetPermissionController.
@SmallTest
public void testSetPermissionController() {
try {
IPermissionController pc = new IPermissionController.Stub() {
public boolean checkPermission(java.lang.String permission, int pid, int uid) {
return true;
}
@Override
public String[] getPackagesForUid(int uid) {
return new String[0];
}
@Override
public boolean isRuntimePermission(String permission) {
return false;
}
};
ServiceManagerNative.asInterface(BinderInternal.getContextObject()).setPermissionController(pc);
fail("IServiceManager.setPermissionController did not throw SecurityException as" + " expected");
} catch (SecurityException e) {
// expected
} catch (RemoteException e) {
fail("Unexpected remote exception");
}
}
use of android.os.IPermissionController in project platform_frameworks_base by android.
the class ServiceManagerPermissionTests method testSetPermissionController.
@SmallTest
public void testSetPermissionController() {
try {
IPermissionController pc = new IPermissionController.Stub() {
public boolean checkPermission(java.lang.String permission, int pid, int uid) {
return true;
}
@Override
public String[] getPackagesForUid(int uid) {
return new String[0];
}
@Override
public boolean isRuntimePermission(String permission) {
return false;
}
};
ServiceManagerNative.asInterface(BinderInternal.getContextObject()).setPermissionController(pc);
fail("IServiceManager.setPermissionController did not throw SecurityException as" + " expected");
} catch (SecurityException e) {
// expected
} catch (RemoteException e) {
fail("Unexpected remote exception");
}
}
Aggregations