Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f85ea86 authored by Yifei Zhang's avatar Yifei Zhang
Browse files

wallpaper: skip visibility for display state change

- Remove the display state listener for force visibility report on Wear
- This is a revert of ag/21736290
- Lint fixes

Flag: com.android.window.flags.no_visibility_check_at_offload_start
Test: manual testing on Wear OS
Bug: 346649944
Bug: 346607030
Change-Id: I166cbaaeb735882191be6ecfe1dc0b6abc412641
parent b6325f3a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;

import static com.android.window.flags.Flags.FLAG_OFFLOAD_COLOR_EXTRACTION;
import static com.android.window.flags.Flags.noConsecutiveVisibilityEvents;
import static com.android.window.flags.Flags.noVisibilityEventOnDisplayStateChange;
import static com.android.window.flags.Flags.offloadColorExtraction;
import static com.android.window.flags.Flags.windowSessionRelayoutInfo;

@@ -2387,7 +2388,9 @@ public abstract class WallpaperService extends Service {
                    @Override
                    public void onDisplayChanged(int displayId) {
                        if (mDisplay.getDisplayId() == displayId) {
                            boolean forceReport = mIsWearOs
                            boolean forceReport =
                                    !noVisibilityEventOnDisplayStateChange()
                                            && mIsWearOs
                                            && mDisplay.getState() != Display.STATE_DOZE_SUSPEND;
                            reportVisibility(forceReport);
                        }
+8 −1
Original line number Diff line number Diff line
@@ -32,3 +32,10 @@ flag {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "no_visibility_event_on_display_state_change"
  namespace: "wear_frameworks"
  description: "Prevent the system from sending visibility event on display state change."
  bug: "331725519"
}