am 3b8389a2: am 912696e7: Merge "Fixed logspam and handling subwindows with the input consumer" into mnc-dev

* commit '3b8389a2f00f34cf3e47e3ccdffa70d55a7dc7f7':
  Fixed logspam and handling subwindows with the input consumer
This commit is contained in:
Selim Cinek
2015-05-26 07:54:39 +00:00
committed by Android Git Automerger
3 changed files with 22 additions and 6 deletions

View File

@@ -274,11 +274,18 @@ public interface WindowManagerPolicy {
* Get the layer at which this window's surface will be Z-ordered.
*/
public int getSurfaceLayer();
/**
* Return the token for the application (actually activity) that owns
* this window. May return null for system windows.
*
* Retrieve the type of the top-level window.
*
* @return the base type of the parent window if attached or its own type otherwise
*/
public int getBaseType();
/**
* Return the token for the application (actually activity) that owns
* this window. May return null for system windows.
*
* @return An IApplicationToken identifying the owning activity.
*/
public IApplicationToken getAppToken();

View File

@@ -6386,8 +6386,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
immersiveSticky = (vis & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) != 0;
final boolean navAllowedHidden = immersive || immersiveSticky;
if (!navAllowedHidden
&& windowTypeToLayerLw(type) > windowTypeToLayerLw(TYPE_INPUT_CONSUMER)) {
if (hideNavBarSysui && !navAllowedHidden && windowTypeToLayerLw(win.getBaseType())
> windowTypeToLayerLw(TYPE_INPUT_CONSUMER)) {
// We can't hide the navbar from this window otherwise the input consumer would not get
// the input events.
vis = (vis & ~View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

View File

@@ -780,6 +780,15 @@ final class WindowState implements WindowManagerPolicy.WindowState {
return mLayer;
}
@Override
public int getBaseType() {
WindowState win = this;
while (win.mAttachedWindow != null) {
win = win.mAttachedWindow;
}
return win.mAttrs.type;
}
@Override
public IApplicationToken getAppToken() {
return mAppToken != null ? mAppToken.appToken : null;