Add screensaver icon to DreamTile

Adds a screensaver icon to DreamTile.

Bug: 230352363
Bug: 232052713
Test: Ran unit tests, no failures, verified on device that icon shows up and is styled like the other tile icons.
Change-Id: Ib0180a289cd158001e3aaadd837b51f75f40abaf
This commit is contained in:
Justin Koh
2022-05-09 14:16:03 -07:00
parent f4dce2587b
commit 330c5ccf63
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<!--
Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorControlNormal">
<path android:fillColor="@android:color/white"
android:pathData="M5,15H19L14.5,9L11,13.5L8.5,10.5ZM6,21Q5.575,21 5.287,20.712Q5,20.425 5,20V19H3Q2.175,19 1.588,18.413Q1,17.825 1,17V6Q1,5.175 1.588,4.588Q2.175,4 3,4H21Q21.825,4 22.413,4.588Q23,5.175 23,6V17Q23,17.825 22.413,18.413Q21.825,19 21,19H19V20Q19,20.425 18.712,20.712Q18.425,21 18,21ZM3,17H21Q21,17 21,17Q21,17 21,17V6Q21,6 21,6Q21,6 21,6H3Q3,6 3,6Q3,6 3,6V17Q3,17 3,17Q3,17 3,17ZM3,17Q3,17 3,17Q3,17 3,17V6Q3,6 3,6Q3,6 3,6Q3,6 3,6Q3,6 3,6V17Q3,17 3,17Q3,17 3,17Z"/>
</vector>

View File

@@ -61,6 +61,7 @@ import javax.inject.Named;
public class DreamTile extends QSTileImpl<QSTile.BooleanState> {
private static final String LOG_TAG = "QSDream";
private final Icon mIcon = ResourceIcon.get(R.drawable.ic_qs_screen_saver);
private final IDreamManager mDreamManager;
private final BroadcastDispatcher mBroadcastDispatcher;
private final SettingObserver mEnabledSettingObserver;
@@ -167,6 +168,7 @@ public class DreamTile extends QSTileImpl<QSTile.BooleanState> {
state.label = getTileLabel();
state.secondaryLabel = getActiveDreamName();
state.contentDescription = getContentDescription(state.secondaryLabel);
state.icon = mIcon;
if (getActiveDream() == null || !isScreensaverEnabled()) {
state.state = Tile.STATE_UNAVAILABLE;