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

Commit 2460e220 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[CS] 6/N=6: Remove CSI's wallpaper tracking & CS#setLockscreenUser.

Now that all classes are migrated to WallpaperRepository, we can remove
CentralSurfaceImpl's wallpaper tracking. We can also remove
CentralSurfaces#setLockscreenUser, because that method was only used to
re-fetch the current wallpaper (which is now no longer done in
CentralSurfaces).

Bug: 277762009
Bug: 277764509
Test: atest CentralSurfacesImplTest
Change-Id: Ia04b2ff7e82b92f3c7708af47323e09b783507b3
parent d25a45b1
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -259,8 +259,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner {

    void readyForKeyguardDone();

    void setLockscreenUser(int newUserId);

    void showKeyguard();

    boolean hideKeyguard();
+0 −40
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ import android.app.PendingIntent;
import android.app.StatusBarManager;
import android.app.TaskInfo;
import android.app.UiModeManager;
import android.app.WallpaperInfo;
import android.app.WallpaperManager;
import android.app.admin.DevicePolicyManager;
import android.content.BroadcastReceiver;
@@ -978,16 +977,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {

        createAndAddWindows(result);

        if (mWallpaperSupported) {
            // Make sure we always have the most current wallpaper info.
            IntentFilter wallpaperChangedFilter = new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED);
            mBroadcastDispatcher.registerReceiver(mWallpaperChangedReceiver, wallpaperChangedFilter,
                    null /* handler */, UserHandle.ALL);
            mWallpaperChangedReceiver.onReceive(mContext, null);
        } else if (DEBUG) {
            Log.v(TAG, "start(): no wallpaper service ");
        }

        // Set up the initial notification state. This needs to happen before CommandQueue.disable()
        setUpPresenter();

@@ -2158,18 +2147,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        }
    };

    /**
     * Notify the shade controller that the current user changed
     *
     * @param newUserId userId of the new user
     */
    @Override
    public void setLockscreenUser(int newUserId) {
        if (mWallpaperSupported) {
            mWallpaperChangedReceiver.onReceive(mContext, null);
        }
    }

    /**
     * Reload some of our resources when the configuration changes.
     *
@@ -3550,23 +3527,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        }
    };

    /**
     * @deprecated See {@link com.android.systemui.wallpapers.data.repository.WallpaperRepository}
     * instead.
     */
    private final BroadcastReceiver mWallpaperChangedReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (!mWallpaperSupported) {
                // Receiver should not have been registered at all...
                Log.wtf(TAG, "WallpaperManager not supported");
                return;
            }
            WallpaperInfo info = mWallpaperManager.getWallpaperInfoForUser(
                    mUserTracker.getUserId());
        }
    };

    private final ConfigurationListener mConfigurationListener = new ConfigurationListener() {
        @Override
        public void onConfigChanged(Configuration newConfig) {
+0 −1
Original line number Diff line number Diff line
@@ -217,7 +217,6 @@ class StatusBarNotificationPresenter implements NotificationPresenter, CommandQu
        // End old BaseStatusBar.userSwitched
        mCommandQueue.animateCollapsePanels();
        mMediaManager.clearCurrentMediaNotification();
        mCentralSurfaces.setLockscreenUser(newUserId);
        updateMediaMetaData(true, false);
    }