Skip to content

Commit 7052406

Browse files
committed
Revert "Allow views to setSystemUiVisibility() with the same value and have it work."
This reverts commit fad9555. Because it just didn't work. (The views kept aggressively re-applying their preferred flags every time view attributes were aggregated.) We'll pursue the original strategy, like lights out mode in HC: if you want to tickle this mode, un-set and re-set the flags (preferably synchronized with the global SystemUI visibility state as reported by onSystemUiVisibilityChanged callbacks). Bug: 5052456
1 parent aff24a5 commit 7052406

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

core/java/android/view/View.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12969,15 +12969,13 @@ public boolean performHapticFeedback(int feedbackConstant, int flags) {
1296912969
* Request that the visibility of the status bar be changed.
1297012970
* @param visibility Bitwise-or of flags {@link #SYSTEM_UI_FLAG_LOW_PROFILE} or
1297112971
* {@link #SYSTEM_UI_FLAG_HIDE_NAVIGATION}.
12972-
*
12973-
* This value will be re-applied immediately, even if the flags have not changed, so a view may
12974-
* easily reassert a particular SystemUiVisibility condition even if the system UI itself has
12975-
* since countermanded the original request.
1297612972
*/
1297712973
public void setSystemUiVisibility(int visibility) {
12978-
mSystemUiVisibility = visibility;
12979-
if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) {
12980-
mParent.recomputeViewAttributes(this);
12974+
if (visibility != mSystemUiVisibility) {
12975+
mSystemUiVisibility = visibility;
12976+
if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) {
12977+
mParent.recomputeViewAttributes(this);
12978+
}
1298112979
}
1298212980
}
1298312981

0 commit comments

Comments
 (0)