Clear low profile mode while forcing client to show system bars am: 3b6bdffa44
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12683363 Change-Id: Iefd90b4aebc1c683fb99a482f5c897d7ea6b7ac4
This commit is contained in:
@@ -1981,11 +1981,7 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
mCompatibleVisibilityInfo.globalVisibility =
|
mCompatibleVisibilityInfo.globalVisibility =
|
||||||
(mCompatibleVisibilityInfo.globalVisibility & ~View.SYSTEM_UI_FLAG_LOW_PROFILE)
|
(mCompatibleVisibilityInfo.globalVisibility & ~View.SYSTEM_UI_FLAG_LOW_PROFILE)
|
||||||
| (mAttachInfo.mSystemUiVisibility & View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
| (mAttachInfo.mSystemUiVisibility & View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
||||||
if (mDispatchedSystemUiVisibility != mCompatibleVisibilityInfo.globalVisibility) {
|
dispatchDispatchSystemUiVisibilityChanged(mCompatibleVisibilityInfo);
|
||||||
mHandler.removeMessages(MSG_DISPATCH_SYSTEM_UI_VISIBILITY);
|
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(
|
|
||||||
MSG_DISPATCH_SYSTEM_UI_VISIBILITY, mCompatibleVisibilityInfo));
|
|
||||||
}
|
|
||||||
if (mAttachInfo.mKeepScreenOn != oldScreenOn
|
if (mAttachInfo.mKeepScreenOn != oldScreenOn
|
||||||
|| mAttachInfo.mSystemUiVisibility != params.subtreeSystemUiVisibility
|
|| mAttachInfo.mSystemUiVisibility != params.subtreeSystemUiVisibility
|
||||||
|| mAttachInfo.mHasSystemUiListeners != params.hasSystemUiListeners) {
|
|| mAttachInfo.mHasSystemUiListeners != params.hasSystemUiListeners) {
|
||||||
@@ -2039,9 +2035,30 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
info.globalVisibility |= systemUiFlag;
|
info.globalVisibility |= systemUiFlag;
|
||||||
info.localChanges &= ~systemUiFlag;
|
info.localChanges &= ~systemUiFlag;
|
||||||
}
|
}
|
||||||
if (mDispatchedSystemUiVisibility != info.globalVisibility) {
|
dispatchDispatchSystemUiVisibilityChanged(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the system is forcing showing any system bar, the legacy low profile flag should be
|
||||||
|
* cleared for compatibility.
|
||||||
|
*
|
||||||
|
* @param showTypes {@link InsetsType types} shown by the system.
|
||||||
|
* @param fromIme {@code true} if the invocation is from IME.
|
||||||
|
*/
|
||||||
|
private void clearLowProfileModeIfNeeded(@InsetsType int showTypes, boolean fromIme) {
|
||||||
|
final SystemUiVisibilityInfo info = mCompatibleVisibilityInfo;
|
||||||
|
if ((showTypes & Type.systemBars()) != 0 && !fromIme
|
||||||
|
&& (info.globalVisibility & SYSTEM_UI_FLAG_LOW_PROFILE) != 0) {
|
||||||
|
info.globalVisibility &= ~SYSTEM_UI_FLAG_LOW_PROFILE;
|
||||||
|
info.localChanges |= SYSTEM_UI_FLAG_LOW_PROFILE;
|
||||||
|
dispatchDispatchSystemUiVisibilityChanged(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dispatchDispatchSystemUiVisibilityChanged(SystemUiVisibilityInfo args) {
|
||||||
|
if (mDispatchedSystemUiVisibility != args.globalVisibility) {
|
||||||
mHandler.removeMessages(MSG_DISPATCH_SYSTEM_UI_VISIBILITY);
|
mHandler.removeMessages(MSG_DISPATCH_SYSTEM_UI_VISIBILITY);
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(MSG_DISPATCH_SYSTEM_UI_VISIBILITY, info));
|
mHandler.sendMessage(mHandler.obtainMessage(MSG_DISPATCH_SYSTEM_UI_VISIBILITY, args));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5008,6 +5025,7 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
String.format("Calling showInsets(%d,%b) on window that no longer"
|
String.format("Calling showInsets(%d,%b) on window that no longer"
|
||||||
+ " has views.", msg.arg1, msg.arg2 == 1));
|
+ " has views.", msg.arg1, msg.arg2 == 1));
|
||||||
}
|
}
|
||||||
|
clearLowProfileModeIfNeeded(msg.arg1, msg.arg2 == 1);
|
||||||
mInsetsController.show(msg.arg1, msg.arg2 == 1);
|
mInsetsController.show(msg.arg1, msg.arg2 == 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user