Loading packages/SystemUI/multivalentTests/src/com/android/systemui/qs/customize/TileQueryHelperTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.testing.TestableLooper; import android.text.TextUtils; import android.util.ArraySet; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; Loading Loading @@ -384,6 +385,7 @@ public class TileQueryHelperTest extends SysuiTestCase { return mSpec; } @NonNull @Override public State getState() { return mState; Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java +5 −1 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -92,6 +92,7 @@ public interface QSTile { CharSequence getTileLabel(); @NonNull State getState(); default LogMaker populate(LogMaker logMaker) { Loading Loading @@ -269,6 +270,7 @@ public interface QSTile { return sb.append(']'); } @NonNull public State copy() { State state = new State(); copyTo(state); Loading Loading @@ -304,6 +306,7 @@ public interface QSTile { return rt; } @androidx.annotation.NonNull @Override public State copy() { AdapterState state = new AdapterState(); Loading @@ -316,6 +319,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(); Loading packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/Tile.kt +1 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ fun Tile( modifier: Modifier = Modifier, detailsViewModel: DetailsViewModel?, ) { val state by tile.state.collectAsStateWithLifecycle(tile.currentState) val state: QSTile.State by tile.state.collectAsStateWithLifecycle(tile.currentState) val currentBounceableInfo by rememberUpdatedState(bounceableInfo) val resources = resources() val uiState = remember(state, resources) { state.toUiState(resources) } Loading packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileViewModel.kt +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.onStart @Immutable Loading @@ -37,6 +38,7 @@ class TileViewModel(private val tile: QSTile, val spec: TileSpec) { awaitClose { tile.removeCallback(callback) } } .onStart { emit(tile.state) } .filterNotNull() .distinctUntilChanged() val currentState: QSTile.State Loading packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -369,6 +369,7 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy mHandler.sendEmptyMessage(H.INITIALIZE); } @androidx.annotation.NonNull public TState getState() { return mState; } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/customize/TileQueryHelperTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.testing.TestableLooper; import android.text.TextUtils; import android.util.ArraySet; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; Loading Loading @@ -384,6 +385,7 @@ public class TileQueryHelperTest extends SysuiTestCase { return mSpec; } @NonNull @Override public State getState() { return mState; Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java +5 −1 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -92,6 +92,7 @@ public interface QSTile { CharSequence getTileLabel(); @NonNull State getState(); default LogMaker populate(LogMaker logMaker) { Loading Loading @@ -269,6 +270,7 @@ public interface QSTile { return sb.append(']'); } @NonNull public State copy() { State state = new State(); copyTo(state); Loading Loading @@ -304,6 +306,7 @@ public interface QSTile { return rt; } @androidx.annotation.NonNull @Override public State copy() { AdapterState state = new AdapterState(); Loading @@ -316,6 +319,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(); Loading
packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/Tile.kt +1 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ fun Tile( modifier: Modifier = Modifier, detailsViewModel: DetailsViewModel?, ) { val state by tile.state.collectAsStateWithLifecycle(tile.currentState) val state: QSTile.State by tile.state.collectAsStateWithLifecycle(tile.currentState) val currentBounceableInfo by rememberUpdatedState(bounceableInfo) val resources = resources() val uiState = remember(state, resources) { state.toUiState(resources) } Loading
packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileViewModel.kt +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.onStart @Immutable Loading @@ -37,6 +38,7 @@ class TileViewModel(private val tile: QSTile, val spec: TileSpec) { awaitClose { tile.removeCallback(callback) } } .onStart { emit(tile.state) } .filterNotNull() .distinctUntilChanged() val currentState: QSTile.State Loading
packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -369,6 +369,7 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy mHandler.sendEmptyMessage(H.INITIALIZE); } @androidx.annotation.NonNull public TState getState() { return mState; } Loading