Loading core/res/res/drawable/default_dream_preview.xml 0 → 100644 +20 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ 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. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@android:color/white"/> </shape> No newline at end of file core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2221,6 +2221,7 @@ <java-symbol type="integer" name="config_dreamsBatteryLevelMinimumWhenNotPowered" /> <java-symbol type="integer" name="config_dreamsBatteryLevelDrainCutoff" /> <java-symbol type="string" name="config_dreamsDefaultComponent" /> <java-symbol type="drawable" name="default_dream_preview" /> <java-symbol type="string" name="config_dozeComponent" /> <java-symbol type="string" name="enable_explore_by_touch_warning_title" /> <java-symbol type="string" name="enable_explore_by_touch_warning_message" /> Loading packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java +7 −4 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import java.util.List; public class DreamBackend { private static final String TAG = "DreamBackend"; private static final boolean DEBUG = false; private final Drawable mDreamPreviewDefault; public static class DreamInfo { public CharSequence caption; Loading Loading @@ -111,6 +112,8 @@ public class DreamBackend { .getBoolean(com.android.internal.R.bool.config_dreamsActivatedOnSleepByDefault); mDreamsActivatedOnDockByDefault = mContext.getResources() .getBoolean(com.android.internal.R.bool.config_dreamsActivatedOnDockByDefault); mDreamPreviewDefault = mContext.getResources().getDrawable( com.android.internal.R.drawable.default_dream_preview); } public List<DreamInfo> getDreamInfos() { Loading @@ -133,11 +136,11 @@ public class DreamBackend { dreamInfo.isActive = dreamInfo.componentName.equals(activeDream); final DreamMetadata dreamMetadata = getDreamMetadata(pm, resolveInfo); if (dreamMetadata != null) { dreamInfo.settingsComponentName = dreamMetadata.mSettingsActivity; dreamInfo.previewImage = dreamMetadata.mPreviewImage; if (dreamInfo.previewImage == null) { dreamInfo.previewImage = mDreamPreviewDefault; } dreamInfos.add(dreamInfo); } Collections.sort(dreamInfos, mComparator); Loading Loading
core/res/res/drawable/default_dream_preview.xml 0 → 100644 +20 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ 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. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@android:color/white"/> </shape> No newline at end of file
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2221,6 +2221,7 @@ <java-symbol type="integer" name="config_dreamsBatteryLevelMinimumWhenNotPowered" /> <java-symbol type="integer" name="config_dreamsBatteryLevelDrainCutoff" /> <java-symbol type="string" name="config_dreamsDefaultComponent" /> <java-symbol type="drawable" name="default_dream_preview" /> <java-symbol type="string" name="config_dozeComponent" /> <java-symbol type="string" name="enable_explore_by_touch_warning_title" /> <java-symbol type="string" name="enable_explore_by_touch_warning_message" /> Loading
packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java +7 −4 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import java.util.List; public class DreamBackend { private static final String TAG = "DreamBackend"; private static final boolean DEBUG = false; private final Drawable mDreamPreviewDefault; public static class DreamInfo { public CharSequence caption; Loading Loading @@ -111,6 +112,8 @@ public class DreamBackend { .getBoolean(com.android.internal.R.bool.config_dreamsActivatedOnSleepByDefault); mDreamsActivatedOnDockByDefault = mContext.getResources() .getBoolean(com.android.internal.R.bool.config_dreamsActivatedOnDockByDefault); mDreamPreviewDefault = mContext.getResources().getDrawable( com.android.internal.R.drawable.default_dream_preview); } public List<DreamInfo> getDreamInfos() { Loading @@ -133,11 +136,11 @@ public class DreamBackend { dreamInfo.isActive = dreamInfo.componentName.equals(activeDream); final DreamMetadata dreamMetadata = getDreamMetadata(pm, resolveInfo); if (dreamMetadata != null) { dreamInfo.settingsComponentName = dreamMetadata.mSettingsActivity; dreamInfo.previewImage = dreamMetadata.mPreviewImage; if (dreamInfo.previewImage == null) { dreamInfo.previewImage = mDreamPreviewDefault; } dreamInfos.add(dreamInfo); } Collections.sort(dreamInfos, mComparator); Loading