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");
}