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

Commit 9add70c3 authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge remote-tracking branch 'origin/lineage-23.0' into a16

parents fd78eab5 07f7fbdb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ public class KeyguardSliceViewControllerTest extends SysuiTestCase {
        when(mView.getContext()).thenReturn(mContext);
        mController = new KeyguardSliceViewController(mHandler, mBgHandler, mView,
                mActivityStarter, mConfigurationController, mDumpManager,
                mDisplayTracker);
                mDisplayTracker, null, null);
        mController.setupUri(KeyguardSliceProvider.KEYGUARD_SLICE_URI);
    }

+2 −0
Original line number Diff line number Diff line
@@ -56,4 +56,6 @@
    <string name="vpn_credentials_username">Користувацьке ім\'я</string>
    <string name="vpn_credentials_password">Пароль</string>
    <string name="vpn_credentials_dialog_connect">З\'єднатись</string>
    <string name="screenshot_delete_label">Видалити</string>
    <string name="screenshot_delete_description">Видалити знімок екрана</string>
</resources>
+35 −1
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.keyguard;

import static android.app.slice.Slice.HINT_LIST_ITEM;

import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow;

import android.app.PendingIntent;
import android.net.Uri;
import android.os.Handler;
@@ -43,11 +45,17 @@ import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.keyguard.KeyguardSliceProvider;
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.power.domain.interactor.PowerInteractor;
import com.android.systemui.power.shared.model.ScreenPowerState;
import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.util.ViewController;

import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.EmptyCoroutineContext;

import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
@@ -71,6 +79,8 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie
    private Uri mKeyguardSliceUri;
    private Slice mSlice;
    private Map<View, PendingIntent> mClickActions;
    private KeyguardInteractor mKeyguardInteractor;
    private PowerInteractor mPowerInteractor;

    ConfigurationController.ConfigurationListener mConfigurationListener =
            new ConfigurationController.ConfigurationListener() {
@@ -110,7 +120,9 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie
            ActivityStarter activityStarter,
            ConfigurationController configurationController,
            DumpManager dumpManager,
            DisplayTracker displayTracker) {
            DisplayTracker displayTracker,
            KeyguardInteractor keyguardInteractor,
            PowerInteractor powerInteractor) {
        super(keyguardSliceView);
        mHandler = handler;
        mBgHandler = bgHandler;
@@ -118,6 +130,28 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie
        mConfigurationController = configurationController;
        mDumpManager = dumpManager;
        mDisplayTracker = displayTracker;
        mKeyguardInteractor = keyguardInteractor;
        mPowerInteractor = powerInteractor;
    }

    @Override
    public void onInit() {
        setupUri(null);
        startCoroutines(EmptyCoroutineContext.INSTANCE);
    }

    void startCoroutines(CoroutineContext context) {
        collectFlow(mView, mKeyguardInteractor.getDozeTimeTick(),
                (Long millis) -> {
                    refresh();
                }, context);

        collectFlow(mView, mPowerInteractor.getScreenPowerState(),
                (ScreenPowerState powerState) -> {
                    if (powerState == ScreenPowerState.SCREEN_TURNING_ON) {
                        refresh();
                    }
                }, context);
    }

    @Override
+5 −0
Original line number Diff line number Diff line
@@ -170,6 +170,7 @@ object KeyguardRootViewBinder {
                        viewModel.alpha(viewState).collect { alpha ->
                            view.alpha = alpha
                            childViews[burnInLayerId]?.alpha = alpha
                            childViews[sliceViewId]?.alpha = alpha
                        }
                    }

@@ -186,6 +187,7 @@ object KeyguardRootViewBinder {
                        // need to add translation to it here same as translationX
                        viewModel.translationY.collect { y ->
                            childViews[burnInLayerId]?.translationY = y
                            childViews[sliceViewId]?.translationY = y
                            childViews[largeClockId]?.translationY = y
                            if (com.android.systemui.shared.Flags.clockReactiveSmartspaceLayout()) {
                                childViews[largeClockDateId]?.translationY = y
@@ -202,6 +204,7 @@ object KeyguardRootViewBinder {
                                state.isToOrFrom(KeyguardState.AOD) -> {
                                    // Large Clock is not translated in the x direction
                                    childViews[burnInLayerId]?.translationX = px
                                    childViews[sliceViewId]?.translationX = px
                                    childViews[aodPromotedNotificationId]?.translationX = px
                                    childViews[aodNotificationIconContainerId]?.translationX = px
                                }
@@ -259,6 +262,7 @@ object KeyguardRootViewBinder {
                    launch {
                        viewModel.burnInLayerVisibility.collect { visibility ->
                            childViews[burnInLayerId]?.visibility = visibility
                            childViews[sliceViewId]?.visibility = visibility
                        }
                    }

@@ -579,6 +583,7 @@ object KeyguardRootViewBinder {
    }

    private val burnInLayerId = R.id.burn_in_layer
    private val sliceViewId = R.id.keyguard_slice_view
    private val aodPromotedNotificationId = AodPromotedNotificationSection.viewId
    private val aodNotificationIconContainerId = R.id.aod_notification_icon_container
    private val largeClockId = customR.id.lockscreen_clock_view_large
+3 −1
Original line number Diff line number Diff line
@@ -206,10 +206,12 @@ constructor(
                if (com.android.systemui.shared.Flags.clockReactiveSmartspaceLayout()) {
                    keyguardClockViewModel.getLargeClockTopMargin() +
                        getDimen(ENHANCED_SMARTSPACE_HEIGHT)
                } else {
                } else if (smartspaceViewModel.isSmartspaceEnabled) {
                    keyguardClockViewModel.getLargeClockTopMargin() +
                        getDimen(DATE_WEATHER_VIEW_HEIGHT) +
                        getDimen(ENHANCED_SMARTSPACE_HEIGHT)
                } else {
                    keyguardClockViewModel.getLargeClockTopMargin()
                }
            connect(
                customR.id.lockscreen_clock_view_large,
Loading