Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75fd97f9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Set fallback wallpaper component to sysui GradientColorWallpaper" into main

parents b90388ea 398b143c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2009,6 +2009,10 @@
    <!-- Component name of the built in wallpaper used to display bitmap wallpapers. This must not be null. -->
    <string name="image_wallpaper_component" translatable="false">com.android.systemui/com.android.systemui.wallpapers.ImageWallpaper</string>

    <!-- Component name of the built in wallpaper that is used when the user-selected wallpaper is
         incompatible with the display's resolution or aspect ratio. -->
    <string name="fallback_wallpaper_component" translatable="false">com.android.systemui/com.android.systemui.wallpapers.GradientColorWallpaper</string>

    <!-- True if WallpaperService is enabled -->
    <bool name="config_enableWallpaperService">true</bool>

+1 −0
Original line number Diff line number Diff line
@@ -2270,6 +2270,7 @@
  <java-symbol type="string" name="heavy_weight_notification" />
  <java-symbol type="string" name="heavy_weight_notification_detail" />
  <java-symbol type="string" name="image_wallpaper_component" />
  <java-symbol type="string" name="fallback_wallpaper_component" />
  <java-symbol type="string" name="input_method_binding_label" />
  <java-symbol type="string" name="input_method_ime_switch_long_click_action_desc" />
  <java-symbol type="string" name="launch_warning_original" />
+5 −1
Original line number Diff line number Diff line
@@ -553,7 +553,11 @@
        <service android:name=".wallpapers.GradientColorWallpaper"
            android:singleUser="true"
            android:permission="android.permission.BIND_WALLPAPER"
            android:exported="true" />
            android:exported="true">
            <meta-data android:name="android.service.wallpaper"
                android:resource="@xml/gradient_color_wallpaper">
            </meta-data>
        </service>

        <activity android:name=".tuner.TunerActivity"
                  android:enabled="false"
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2025 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
  -->
<wallpaper
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:showMetadataInPreview="false"
    android:supportsMultipleDisplays="true" />
 No newline at end of file
+27 −2
Original line number Diff line number Diff line
@@ -771,6 +771,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
     */
    private final ComponentName mImageWallpaper;

    /**
     * Name of the component that is used when the user-selected wallpaper is incompatible with the
     * display's resolution or aspect ratio.
     */
    @Nullable private final ComponentName mFallbackWallpaperComponent;

    /**
     * Default image wallpaper shall never changed after system service started, caching it when we
     * first read the image file.
@@ -1601,6 +1607,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
        mShuttingDown = false;
        mImageWallpaper = ComponentName.unflattenFromString(
                context.getResources().getString(R.string.image_wallpaper_component));
        if (enableConnectedDisplaysWallpaper()) {
            mFallbackWallpaperComponent = ComponentName.unflattenFromString(
                    context.getResources().getString(R.string.fallback_wallpaper_component));
        } else {
            mFallbackWallpaperComponent = null;
        }
        ComponentName defaultComponent = WallpaperManager.getCmfDefaultWallpaperComponent(context);
        mDefaultWallpaperComponent = defaultComponent == null ? mImageWallpaper : defaultComponent;
        mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class);
@@ -3613,6 +3625,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
            if (componentName != null && !componentName.equals(mImageWallpaper)) {
                // The requested component is not the static wallpaper service, so make sure it's
                // actually a wallpaper service.
                if (mFallbackWallpaperComponent != null
                        && componentName.equals(mFallbackWallpaperComponent)) {
                    // The fallback wallpaper does not declare WallpaperService.SERVICE_INTERFACE
                    // action in its intent filter to prevent it from being listed in the wallpaper
                    // picker. And thus, use explicit intent to query the metadata.
                    intent = new Intent().setComponent(mFallbackWallpaperComponent);
                }
                List<ResolveInfo> ris =
                        mIPackageManager.queryIntentServices(intent,
                                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
@@ -4100,8 +4119,14 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
            mFallbackWallpaper.allowBackup = false;
            mFallbackWallpaper.wallpaperId = makeWallpaperIdLocked();
            mFallbackWallpaper.mBindSource = BindSource.INITIALIZE_FALLBACK;
            if (mFallbackWallpaperComponent == null) {
                bindWallpaperComponentLocked(mDefaultWallpaperComponent, true, false,
                        mFallbackWallpaper, null);
            } else {
                mFallbackWallpaper.mWhich = FLAG_SYSTEM | FLAG_LOCK;
                bindWallpaperComponentLocked(mFallbackWallpaperComponent, true, false,
                        mFallbackWallpaper, null);
            }
        }
    }

Loading