summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/java/com/android/server/wm/WindowManagerService.java21
-rw-r--r--services/java/com/android/server/wm/WindowState.java8
2 files changed, 10 insertions, 19 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 03dcced..8c8eea8 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -2452,22 +2452,15 @@ public class WindowManagerService extends IWindowManager.Stub
public void updateAppOpsState() {
synchronized(mWindowMap) {
- boolean changed = false;
- for (int i=0; i<mDisplayContents.size(); i++) {
- DisplayContent display = mDisplayContents.valueAt(i);
- WindowList windows = display.getWindowList();
- for (int j=0; j<windows.size(); j++) {
- final WindowState win = windows.get(j);
- if (win.mAppOp != AppOpsManager.OP_NONE) {
- changed |= win.setAppOpVisibilityLw(mAppOps.checkOpNoThrow(win.mAppOp,
- win.getOwningUid(),
- win.getOwningPackage()) == AppOpsManager.MODE_ALLOWED);
- }
+ AllWindowsIterator iterator = new AllWindowsIterator();
+ while (iterator.hasNext()) {
+ final WindowState win = iterator.next();
+ if (win.mAppOp != AppOpsManager.OP_NONE) {
+ final int mode = mAppOps.checkOpNoThrow(win.mAppOp, win.getOwningUid(),
+ win.getOwningPackage());
+ win.setAppOpVisibilityLw(mode == AppOpsManager.MODE_ALLOWED);
}
}
- if (changed) {
- scheduleAnimationLocked();
- }
}
}
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index 8dda544..bb08519 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -1058,7 +1058,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
return true;
}
- public boolean setAppOpVisibilityLw(boolean state) {
+ public void setAppOpVisibilityLw(boolean state) {
if (mAppOpVisibility != state) {
mAppOpVisibility = state;
if (state) {
@@ -1068,13 +1068,11 @@ final class WindowState implements WindowManagerPolicy.WindowState {
// ops modifies they should only be hidden by policy due to the
// lock screen, and the user won't be changing this if locked.
// Plus it will quickly be fixed the next time we do a layout.
- showLw(true, false);
+ showLw(true, true);
} else {
- hideLw(true, false);
+ hideLw(true, true);
}
- return true;
}
- return false;
}
@Override