Merge "Only force drawing status bar background if target >= N" into nyc-dev
am: fe52f91
* commit 'fe52f91f0cee39b186b1b892fc3344d3279640cf':
Only force drawing status bar background if target >= N
Change-Id: I424d896d801dc57ed8e14fce3205644060d33e8e
This commit is contained in:
@@ -1239,6 +1239,13 @@ public interface WindowManager extends ViewManager {
|
||||
*/
|
||||
public static final int PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME = 0x00010000;
|
||||
|
||||
/**
|
||||
* Flag to indicate that this window is always drawing the status bar background, no matter
|
||||
* what the other flags are.
|
||||
* @hide
|
||||
*/
|
||||
public static final int PRIVATE_FLAG_FORCE_DRAW_STATUS_BAR_BACKGROUND = 0x00020000;
|
||||
|
||||
/**
|
||||
* Control flags that are private to the platform.
|
||||
* @hide
|
||||
|
||||
@@ -45,7 +45,6 @@ import android.graphics.PixelFormat;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Shader;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.RemoteException;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
@@ -81,6 +80,8 @@ import static android.app.ActivityManager.StackId;
|
||||
import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
|
||||
import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
|
||||
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
|
||||
import static android.os.Build.VERSION_CODES.M;
|
||||
import static android.os.Build.VERSION_CODES.N;
|
||||
import static android.view.View.MeasureSpec.AT_MOST;
|
||||
import static android.view.View.MeasureSpec.EXACTLY;
|
||||
import static android.view.View.MeasureSpec.getMode;
|
||||
@@ -171,7 +172,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
|
||||
private final Interpolator mShowInterpolator;
|
||||
private final Interpolator mHideInterpolator;
|
||||
private final int mBarEnterExitDuration;
|
||||
private final boolean mForceWindowDrawsStatusBarBackground;
|
||||
final boolean mForceWindowDrawsStatusBarBackground;
|
||||
private final int mSemiTransparentStatusBarColor;
|
||||
|
||||
private final BackgroundFallback mBackgroundFallback = new BackgroundFallback();
|
||||
@@ -236,7 +237,8 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
|
||||
mBarEnterExitDuration = context.getResources().getInteger(
|
||||
R.integer.dock_enter_exit_duration);
|
||||
mForceWindowDrawsStatusBarBackground = context.getResources().getBoolean(
|
||||
R.bool.config_forceWindowDrawsStatusBarBackground);
|
||||
R.bool.config_forceWindowDrawsStatusBarBackground)
|
||||
&& context.getApplicationInfo().targetSdkVersion >= N;
|
||||
mSemiTransparentStatusBarColor = context.getResources().getColor(
|
||||
R.color.system_bar_background_semi_transparent, null /* theme */);
|
||||
|
||||
@@ -2210,7 +2212,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
|
||||
public void onDestroyActionMode(ActionMode mode) {
|
||||
mWrapped.onDestroyActionMode(mode);
|
||||
final boolean isMncApp = mContext.getApplicationInfo().targetSdkVersion
|
||||
>= Build.VERSION_CODES.M;
|
||||
>= M;
|
||||
final boolean isPrimary;
|
||||
final boolean isFloating;
|
||||
if (isMncApp) {
|
||||
|
||||
@@ -2435,6 +2435,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
|
||||
mNavigationBarColor = a.getColor(R.styleable.Window_navigationBarColor, 0xFF000000);
|
||||
}
|
||||
|
||||
WindowManager.LayoutParams params = getAttributes();
|
||||
|
||||
// Non-floating windows on high end devices must put up decor beneath the system bars and
|
||||
// therefore must know about visibility changes of those.
|
||||
if (!mIsFloating && ActivityManager.isHighEndGfx()) {
|
||||
@@ -2444,6 +2446,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
|
||||
setFlags(FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS,
|
||||
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS & ~getForcedWindowFlags());
|
||||
}
|
||||
if (mDecor.mForceWindowDrawsStatusBarBackground) {
|
||||
params.privateFlags |= PRIVATE_FLAG_FORCE_DRAW_STATUS_BAR_BACKGROUND;
|
||||
}
|
||||
}
|
||||
if (a.getBoolean(R.styleable.Window_windowLightStatusBar, false)) {
|
||||
decor.setSystemUiVisibility(
|
||||
@@ -2459,8 +2464,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
|
||||
}
|
||||
}
|
||||
|
||||
WindowManager.LayoutParams params = getAttributes();
|
||||
|
||||
if (!hasSoftInputMode()) {
|
||||
params.softInputMode = a.getInt(
|
||||
R.styleable.Window_windowSoftInputMode,
|
||||
|
||||
Reference in New Issue
Block a user