import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
+import android.hardware.configstore.V1_0.ISurfaceFlingerConfigs;
+import android.hardware.configstore.V1_0.OptionalBool;
import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManagerInternal;
import android.hardware.input.InputManager;
import android.view.IOnKeyguardExitResult;
import android.view.IPinnedStackListener;
import android.view.IRotationWatcher;
+import android.view.IWallpaperVisibilityListener;
import android.view.IWindow;
import android.view.IWindowId;
import android.view.IWindowManager;
}
class RotationWatcher {
- IRotationWatcher mWatcher;
- IBinder.DeathRecipient mDeathRecipient;
- int mDisplayId;
+ final IRotationWatcher mWatcher;
+ final IBinder.DeathRecipient mDeathRecipient;
+ final int mDisplayId;
RotationWatcher(IRotationWatcher watcher, IBinder.DeathRecipient deathRecipient,
int displayId) {
mWatcher = watcher;
ArrayList<RotationWatcher> mRotationWatchers = new ArrayList<>();
int mDeferredRotationPauseCount;
+ final WallpaperVisibilityListeners mWallpaperVisibilityListeners =
+ new WallpaperVisibilityListeners();
int mSystemDecorLayer = 0;
final Rect mScreenRect = new Rect();
final DisplayManager mDisplayManager;
private final Display[] mDisplays;
+ // Indicates whether this device supports wide color gamut rendering
+ private boolean mHasWideColorGamutSupport;
+
// Who is holding the screen on.
private Session mHoldingScreenOn;
private PowerManager.WakeLock mHoldingScreenWakeLock;
return mPolicy.isKeyguardLocked();
}
+ public boolean isKeyguardShowingAndNotOccluded() {
+ return mPolicy.isKeyguardShowingAndNotOccluded();
+ }
+
@Override
public boolean isKeyguardSecure() {
int userId = UserHandle.getCallingUserId();
}
}
+ @Override
+ public boolean registerWallpaperVisibilityListener(IWallpaperVisibilityListener listener,
+ int displayId) {
+ synchronized (mWindowMap) {
+ final DisplayContent displayContent = mRoot.getDisplayContentOrCreate(displayId);
+ if (displayContent == null) {
+ throw new IllegalArgumentException("Trying to register visibility event "
+ + "for invalid display: " + displayId);
+ }
+ mWallpaperVisibilityListeners.registerWallpaperVisibilityListener(listener, displayId);
+ return displayContent.mWallpaperController.isWallpaperVisible();
+ }
+ }
+
+ @Override
+ public void unregisterWallpaperVisibilityListener(IWallpaperVisibilityListener listener,
+ int displayId) {
+ synchronized (mWindowMap) {
+ mWallpaperVisibilityListeners
+ .unregisterWallpaperVisibilityListener(listener, displayId);
+ }
+ }
+
/**
* Apps that use the compact menu panel (as controlled by the panelMenuIsCompact
* theme attribute) on devices that feature a physical options menu key attempt to position
public void systemReady() {
mPolicy.systemReady();
mTaskSnapshotController.systemReady();
+ mHasWideColorGamutSupport = queryWideColorGamutSupport();
+ }
+
+ private static boolean queryWideColorGamutSupport() {
+ try {
+ ISurfaceFlingerConfigs surfaceFlinger = ISurfaceFlingerConfigs.getService();
+ OptionalBool hasWideColor = surfaceFlinger.hasWideColorDisplay();
+ if (hasWideColor != null) {
+ return hasWideColor.value;
+ }
+ } catch (RemoteException e) {
+ // Ignore, we're in big trouble if we can't talk to SurfaceFlinger's config store
+ }
+ return false;
}
// -------------------------------------------------------------
}
@Override
+ public Region getCurrentImeTouchRegion() {
+ synchronized (mWindowMap) {
+ final Region r = new Region();
+ if (mInputMethodWindow != null) {
+ mInputMethodWindow.getTouchableRegion(r);
+ }
+ return r;
+ }
+ }
+
+ @Override
public boolean hasNavigationBar() {
return mPolicy.hasNavigationBar();
}
}
@Override
+ public boolean isKeyguardShowingAndNotOccluded() {
+ return WindowManagerService.this.isKeyguardShowingAndNotOccluded();
+ }
+
+ @Override
public void showGlobalActions() {
WindowManagerService.this.showGlobalActions();
}
}
}
}
+
+ boolean hasWideColorGamutSupport() {
+ return mHasWideColorGamutSupport;
+ }
}