Improve AOSP stock statusbar suppression
This commit is contained in:
+32
@@ -80,6 +80,7 @@ final class StockLayoutCanvasController {
|
||||
"entries"
|
||||
};
|
||||
private static final Set<String> TARGET_ID_NAMES = Set.of(
|
||||
"clock",
|
||||
"left_clock_container",
|
||||
"notification_icon_area",
|
||||
"notification_icon_area_inner",
|
||||
@@ -99,6 +100,7 @@ final class StockLayoutCanvasController {
|
||||
);
|
||||
|
||||
private static final Set<String> LAYOUT_OFF_UNLOCKED_ONLY_IDS = Set.of(
|
||||
"clock",
|
||||
"left_clock_container",
|
||||
"notification_icon_area",
|
||||
"notification_icon_area_inner",
|
||||
@@ -2424,6 +2426,7 @@ final class StockLayoutCanvasController {
|
||||
renderResult.layoutChanged(),
|
||||
false,
|
||||
activeScene);
|
||||
hideTrackedUnlockedStockSurfaces(root);
|
||||
hideTrackedStatusChipSources(root);
|
||||
if (renderResult.chipSourcesChanged()
|
||||
&& !scanTree
|
||||
@@ -2453,6 +2456,35 @@ final class StockLayoutCanvasController {
|
||||
});
|
||||
}
|
||||
|
||||
private void hideTrackedUnlockedStockSurfaces(View root) {
|
||||
if (root == null || trackedUnlockedStockSurfaces.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
ArrayDeque<View> staleViews = new ArrayDeque<>();
|
||||
for (View view : trackedUnlockedStockSurfaces) {
|
||||
if (view == null || !view.isAttachedToWindow()) {
|
||||
staleViews.add(view);
|
||||
continue;
|
||||
}
|
||||
if (!isDescendantOf(view, root)) {
|
||||
continue;
|
||||
}
|
||||
if (ownedIconHostManager.isOwnedHost(view)) {
|
||||
staleViews.add(view);
|
||||
continue;
|
||||
}
|
||||
if (isTrackableStatusChipSurface(view)) {
|
||||
hideStatusChipSurface(root, view);
|
||||
} else if (shouldHideNonChipView(view)) {
|
||||
hideView(view, true);
|
||||
} else {
|
||||
restoreView(view);
|
||||
staleViews.add(view);
|
||||
}
|
||||
}
|
||||
removeStaleViews(trackedUnlockedStockSurfaces, staleViews);
|
||||
}
|
||||
|
||||
private void applyLayoutOffRoot(
|
||||
View root,
|
||||
SbtSettings settings,
|
||||
|
||||
Reference in New Issue
Block a user