Merge tag 'android-16.0.0_r3' into 16-dev
Android 16.0.0 Release 3 (BP3A.250905.014) Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
package com.android.systemui.plugins.qs;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -22,6 +21,7 @@ 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,6 +33,7 @@ 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)
|
||||
@@ -41,7 +42,7 @@ import java.util.function.Supplier;
|
||||
@DependsOn(target = Icon.class)
|
||||
@DependsOn(target = State.class)
|
||||
public interface QSTile {
|
||||
int VERSION = 4;
|
||||
int VERSION = 5;
|
||||
|
||||
String getTileSpec();
|
||||
|
||||
@@ -77,6 +78,7 @@ 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
|
||||
@@ -92,6 +94,7 @@ public interface QSTile {
|
||||
|
||||
CharSequence getTileLabel();
|
||||
|
||||
@NonNull
|
||||
State getState();
|
||||
|
||||
default LogMaker populate(LogMaker logMaker) {
|
||||
@@ -120,6 +123,36 @@ 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;
|
||||
@@ -169,6 +202,7 @@ 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;
|
||||
@@ -183,7 +217,10 @@ public interface QSTile {
|
||||
}
|
||||
}
|
||||
|
||||
/** Get the text for secondaryLabel. */
|
||||
/**
|
||||
* If the current secondaryLabel value is not empty, ignore the given input and return
|
||||
* the current value. Otherwise return current value.
|
||||
*/
|
||||
public CharSequence getSecondaryLabel(CharSequence stateText) {
|
||||
// Use a local reference as the value might change from other threads
|
||||
CharSequence localSecondaryLabel = secondaryLabel;
|
||||
@@ -212,6 +249,7 @@ 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;
|
||||
@@ -227,6 +265,7 @@ public interface QSTile {
|
||||
other.dualTarget = dualTarget;
|
||||
other.isTransient = isTransient;
|
||||
other.handlesLongClick = handlesLongClick;
|
||||
other.handlesSecondaryClick = handlesSecondaryClick;
|
||||
other.sideViewCustomDrawable = sideViewCustomDrawable;
|
||||
return changed;
|
||||
}
|
||||
@@ -252,11 +291,13 @@ 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);
|
||||
@@ -292,6 +333,7 @@ public interface QSTile {
|
||||
return rt;
|
||||
}
|
||||
|
||||
@androidx.annotation.NonNull
|
||||
@Override
|
||||
public State copy() {
|
||||
AdapterState state = new AdapterState();
|
||||
@@ -304,6 +346,7 @@ public interface QSTile {
|
||||
class BooleanState extends AdapterState {
|
||||
public static final int VERSION = 1;
|
||||
|
||||
@androidx.annotation.NonNull
|
||||
@Override
|
||||
public State copy() {
|
||||
BooleanState state = new BooleanState();
|
||||
|
||||
Reference in New Issue
Block a user