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

Commit 702589d0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Preparations for different scrim depending on wallpaper" into nyc-mr1-dev

parents 165b011a e31f6b80
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ interface IWallpaperManager {
     * information about that wallpaper.  Otherwise, if it is a static image,
     * simply return null.
     */
    WallpaperInfo getWallpaperInfo();
    WallpaperInfo getWallpaperInfo(int userId);

    /**
     * Clear the system wallpaper.
+2 −1
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.Log;
import android.view.WindowManagerGlobal;
@@ -783,7 +784,7 @@ public class WallpaperManager {
                Log.w(TAG, "WallpaperService not running");
                throw new RuntimeException(new DeadSystemException());
            } else {
                return sGlobals.mService.getWallpaperInfo();
                return sGlobals.mService.getWallpaperInfo(UserHandle.myUserId());
            }
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
+2 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import com.android.systemui.assist.AssistManager;
import com.android.systemui.statusbar.BaseStatusBar;
import com.android.systemui.statusbar.ScrimView;
import com.android.systemui.statusbar.phone.KeyguardBouncer;
import com.android.systemui.statusbar.phone.LockscreenWallpaper;
import com.android.systemui.statusbar.phone.NotificationIconAreaController;
import com.android.systemui.statusbar.phone.PhoneStatusBar;
import com.android.systemui.statusbar.phone.QSTileHost;
@@ -92,7 +93,7 @@ public class SystemUIFactory {
    }

    public ScrimController createScrimController(ScrimView scrimBehind, ScrimView scrimInFront,
            View headsUpScrim) {
            View headsUpScrim, LockscreenWallpaper lockscreenWallpaper) {
        return new ScrimController(scrimBehind, scrimInFront, headsUpScrim);
    }

+6 −5
Original line number Diff line number Diff line
@@ -788,11 +788,15 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        mBackdropFront = (ImageView) mBackdrop.findViewById(R.id.backdrop_front);
        mBackdropBack = (ImageView) mBackdrop.findViewById(R.id.backdrop_back);

        if (ENABLE_LOCKSCREEN_WALLPAPER) {
            mLockscreenWallpaper = new LockscreenWallpaper(mContext, this, mHandler);
        }

        ScrimView scrimBehind = (ScrimView) mStatusBarWindow.findViewById(R.id.scrim_behind);
        ScrimView scrimInFront = (ScrimView) mStatusBarWindow.findViewById(R.id.scrim_in_front);
        View headsUpScrim = mStatusBarWindow.findViewById(R.id.heads_up_scrim);
        mScrimController = SystemUIFactory.getInstance().createScrimController(
                scrimBehind, scrimInFront, headsUpScrim);
                scrimBehind, scrimInFront, headsUpScrim, mLockscreenWallpaper);
        if (mScrimSrcModeEnabled) {
            Runnable runnable = new Runnable() {
                @Override
@@ -822,10 +826,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                mKeyguardBottomArea.getLockIcon());
        mKeyguardBottomArea.setKeyguardIndicationController(mKeyguardIndicationController);

        if (ENABLE_LOCKSCREEN_WALLPAPER) {
            mLockscreenWallpaper = new LockscreenWallpaper(mContext, this, mHandler);
        }

        // set the initial view visibility
        setAreThereNotifications();

@@ -3513,6 +3513,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        setControllerUsers();
        clearCurrentMediaNotification();
        mLockscreenWallpaper.setCurrentUser(newUserId);
        mScrimController.setCurrentUser(newUserId);
        updateMediaMetaData(true, false);
    }

+13 −2
Original line number Diff line number Diff line
@@ -50,8 +50,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
    public static final Interpolator KEYGUARD_FADE_OUT_INTERPOLATOR_LOCKED
            = new PathInterpolator(0.3f, 0f, 0.8f, 1f);
    private static final float SCRIM_BEHIND_ALPHA = 0.62f;
    private static final float SCRIM_BEHIND_ALPHA_KEYGUARD = 0.45f;
    private static final float SCRIM_BEHIND_ALPHA_UNLOCKING = 0.2f;
    protected static final float SCRIM_BEHIND_ALPHA_KEYGUARD = 0.45f;
    protected static final float SCRIM_BEHIND_ALPHA_UNLOCKING = 0.2f;
    private static final float SCRIM_IN_FRONT_ALPHA = 0.75f;
    private static final float SCRIM_IN_FRONT_ALPHA_LOCKED = 0.85f;
    private static final int TAG_KEY_ANIM = R.id.scrim;
@@ -126,6 +126,13 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
        scheduleUpdate();
    }

    protected void setScrimBehindValues(float scrimBehindAlphaKeyguard,
            float scrimBehindAlphaUnlocking) {
        mScrimBehindAlphaKeyguard = scrimBehindAlphaKeyguard;
        mScrimBehindAlphaUnlocking = scrimBehindAlphaUnlocking;
        scheduleUpdate();
    }

    public void onTrackingStarted() {
        mExpanding = true;
        mDarkenWhileDragging = !mUnlockMethodCache.canSkipBouncer();
@@ -567,4 +574,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
                R.dimen.heads_up_scrim_height);
        mHeadsUpScrim.setLayoutParams(layoutParams);
    }

    public void setCurrentUser(int currentUser) {
        // Don't care in the base class.
    }
}
Loading