feat: Add option to clear home screen in settings (#6125)

Signed-off-by: abhixv <abhi.sharma1@hotmail.com>
This commit is contained in:
Abhishek Sharma
2025-12-20 03:26:30 +05:30
committed by Pun Butrach
parent 9898749619
commit 5f3a03f4fb
1577 changed files with 112563 additions and 80248 deletions
@@ -14,6 +14,7 @@
package com.android.systemui.plugins.qs;
import android.annotation.NonNull;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
@@ -21,7 +22,6 @@ import android.metrics.LogMaker;
import android.service.quicksettings.Tile;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.internal.logging.InstanceId;
@@ -33,7 +33,6 @@ import com.android.systemui.plugins.qs.QSTile.Icon;
import com.android.systemui.plugins.qs.QSTile.State;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Supplier;
@ProvidesInterface(version = QSTile.VERSION)
@@ -42,7 +41,7 @@ import java.util.function.Supplier;
@DependsOn(target = Icon.class)
@DependsOn(target = State.class)
public interface QSTile {
int VERSION = 5;
int VERSION = 4;
String getTileSpec();
@@ -78,7 +77,6 @@ public interface QSTile {
void longClick(@Nullable Expandable expandable);
void userSwitch(int currentUser);
int getCurrentTileUser();
/**
* @deprecated not needed as {@link com.android.internal.logging.UiEvent} will use
@@ -94,7 +92,6 @@ public interface QSTile {
CharSequence getTileLabel();
@NonNull
State getState();
default LogMaker populate(LogMaker logMaker) {
@@ -123,36 +120,6 @@ public interface QSTile {
*/
boolean isListening();
/**
* Get this tile's {@link TileDetailsViewModel} through a callback.
*
* Please only override this method if the tile can't get its {@link TileDetailsViewModel}
* synchronously and thus need a callback to defer it.
*
* @return a boolean indicating whether this tile has a {@link TileDetailsViewModel}. The tile's
* {@link TileDetailsViewModel} will be passed to the callback. Please always return true when
* overriding this method. Return false will make the tile display its dialog instead of details
* view, and it will not wait for the callback to be returned before proceeding to show the
* dialog.
*/
default boolean getDetailsViewModel(Consumer<TileDetailsViewModel> callback) {
TileDetailsViewModel tileDetailsViewModel = getDetailsViewModel();
callback.accept(tileDetailsViewModel);
return tileDetailsViewModel != null;
}
/**
* Return this tile's {@link TileDetailsViewModel} to be used to render the TileDetailsView.
*
* Please only override this method if the tile doesn't need a callback to set its
* {@link TileDetailsViewModel}.
*/
default TileDetailsViewModel getDetailsViewModel() {
return null;
}
boolean isDestroyed();
@ProvidesInterface(version = Callback.VERSION)
interface Callback {
static final int VERSION = 2;
@@ -202,7 +169,6 @@ public interface QSTile {
public boolean isTransient = false;
public String expandedAccessibilityClassName;
public boolean handlesLongClick = true;
public boolean handlesSecondaryClick = false;
@Nullable
public Drawable sideViewCustomDrawable;
public String spec;
@@ -217,10 +183,7 @@ public interface QSTile {
}
}
/**
* If the current secondaryLabel value is not empty, ignore the given input and return
* the current value. Otherwise return current value.
*/
/** Get the text for secondaryLabel. */
public CharSequence getSecondaryLabel(CharSequence stateText) {
// Use a local reference as the value might change from other threads
CharSequence localSecondaryLabel = secondaryLabel;
@@ -249,7 +212,6 @@ public interface QSTile {
|| !Objects.equals(other.isTransient, isTransient)
|| !Objects.equals(other.dualTarget, dualTarget)
|| !Objects.equals(other.handlesLongClick, handlesLongClick)
|| !Objects.equals(other.handlesSecondaryClick, handlesSecondaryClick)
|| !Objects.equals(other.sideViewCustomDrawable, sideViewCustomDrawable);
other.spec = spec;
other.icon = icon;
@@ -265,7 +227,6 @@ public interface QSTile {
other.dualTarget = dualTarget;
other.isTransient = isTransient;
other.handlesLongClick = handlesLongClick;
other.handlesSecondaryClick = handlesSecondaryClick;
other.sideViewCustomDrawable = sideViewCustomDrawable;
return changed;
}
@@ -291,13 +252,11 @@ public interface QSTile {
sb.append(",disabledByPolicy=").append(disabledByPolicy);
sb.append(",dualTarget=").append(dualTarget);
sb.append(",isTransient=").append(isTransient);
sb.append(",handlesSecondaryClick=").append(handlesSecondaryClick);
sb.append(",state=").append(state);
sb.append(",sideViewCustomDrawable=").append(sideViewCustomDrawable);
return sb.append(']');
}
@NonNull
public State copy() {
State state = new State();
copyTo(state);
@@ -333,7 +292,6 @@ public interface QSTile {
return rt;
}
@androidx.annotation.NonNull
@Override
public State copy() {
AdapterState state = new AdapterState();
@@ -346,7 +304,6 @@ public interface QSTile {
class BooleanState extends AdapterState {
public static final int VERSION = 1;
@androidx.annotation.NonNull
@Override
public State copy() {
BooleanState state = new BooleanState();