Merge "Clear binder identity before dispatching ap op mode changes." into mnc-dev
This commit is contained in:
@@ -408,11 +408,19 @@ public class AppOpsService extends IAppOpsService.Stub {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (repCbs != null) {
|
if (repCbs != null) {
|
||||||
for (int i=0; i<repCbs.size(); i++) {
|
// There are components watching for mode changes such as window manager
|
||||||
try {
|
// and location manager which are in our process. The callbacks in these
|
||||||
repCbs.get(i).mCallback.opChanged(code, packageName);
|
// components may require permissions our remote caller does not have.
|
||||||
} catch (RemoteException e) {
|
final long identity = Binder.clearCallingIdentity();
|
||||||
|
try {
|
||||||
|
for (int i = 0; i < repCbs.size(); i++) {
|
||||||
|
try {
|
||||||
|
repCbs.get(i).mCallback.opChanged(code, packageName);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(identity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user