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

Commit 26ce4112 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7272808 from 6c48bd50 to sc-v2-release

Change-Id: I60905fb16fa47f29f7222bc13af6fca748294652
parents 5c183ac4 6c48bd50
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ import android.app.Activity;
import android.app.WallpaperColors;
import android.content.Intent;
import android.graphics.Rect;
import android.graphics.RectF;
import android.service.wallpaper.WallpaperService;
import android.view.Surface;
import android.view.SurfaceView;
@@ -42,7 +41,6 @@ import com.android.wallpaper.util.SizeCalculator;
import com.android.wallpaper.util.WallpaperConnection;
import com.android.wallpaper.util.WallpaperConnection.WallpaperConnectionListener;
import com.android.wallpaper.util.WallpaperSurfaceCallback;
import com.android.wallpaper.widget.LiveTileOverlay;
import com.android.wallpaper.widget.WallpaperColorsLoader;

/** A class to load the wallpaper to the view. */
@@ -76,7 +74,7 @@ public class WallpaperPreviewer implements LifecycleObserver {
        mWallpaperSurface = wallpaperSurface;
        mWallpaperSurfaceCallback = new WallpaperSurfaceCallback(activity, mHomePreview,
                mWallpaperSurface, this::setUpWallpaperPreview);
        mWallpaperSurface.setZOrderMediaOverlay(false);
        mWallpaperSurface.setZOrderMediaOverlay(true);
        mWallpaperSurface.getHolder().addCallback(mWallpaperSurfaceCallback);

        View rootView = homePreview.getRootView();
@@ -118,7 +116,6 @@ public class WallpaperPreviewer implements LifecycleObserver {
    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    @MainThread
    public void onDestroy() {
        LiveTileOverlay.INSTANCE.detach(mHomePreview.getOverlay());
        if (mWallpaperConnection != null) {
            mWallpaperConnection.disconnect();
            mWallpaperConnection = null;
@@ -157,7 +154,6 @@ public class WallpaperPreviewer implements LifecycleObserver {
                        .loadPreviewImage(mActivity,
                                renderInImageWallpaperSurface ? homeImageWallpaper : mHomePreview,
                                mActivity.getResources().getColor(R.color.secondary_color));
                LiveTileOverlay.INSTANCE.detach(mHomePreview.getOverlay());
                if (mWallpaper instanceof LiveWallpaperInfo) {
                    mWallpaper.getThumbAsset(mActivity.getApplicationContext())
                            .loadPreviewImage(
@@ -209,16 +205,12 @@ public class WallpaperPreviewer implements LifecycleObserver {
                                mWallpaperColorsListener.onWallpaperColorsChanged(colors);
                            }
                        }
                    }, mPreviewGlobalRect);

            LiveTileOverlay.INSTANCE.update(new RectF(mPreviewLocalRect),
                    ((CardView) mHomePreview.getParent()).getRadius());
                    }, mWallpaperSurface);

            mWallpaperConnection.setVisibility(true);
            mHomePreview.post(() -> {
                if (mWallpaperConnection != null && !mWallpaperConnection.connect()) {
                    mWallpaperConnection = null;
                    LiveTileOverlay.INSTANCE.detach(mHomePreview.getOverlay());
                }
            });
        } else {