Merge "Call AppOpsService from the handler thread" into nyc-dev

This commit is contained in:
Fyodor Kupolov
2016-06-17 15:59:06 +00:00
committed by Android (Google) Code Review

View File

@@ -1303,15 +1303,17 @@ public class UserManagerService extends IUserManager.Stub {
} }
if (mAppOpsService != null) { // We skip it until system-ready. if (mAppOpsService != null) { // We skip it until system-ready.
final long token = Binder.clearCallingIdentity(); mHandler.post(new Runnable() {
@Override
public void run() {
try { try {
mAppOpsService.setUserRestrictions(effective, mUserRestriconToken, userId); mAppOpsService.setUserRestrictions(effective, mUserRestriconToken, userId);
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(LOG_TAG, "Unable to notify AppOpsService of UserRestrictions"); Log.w(LOG_TAG, "Unable to notify AppOpsService of UserRestrictions");
} finally {
Binder.restoreCallingIdentity(token);
} }
} }
});
}
propagateUserRestrictionsLR(userId, effective, prevAppliedRestrictions); propagateUserRestrictionsLR(userId, effective, prevAppliedRestrictions);