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

Commit db473ca7 authored by Matt Pietal's avatar Matt Pietal Committed by Automerger Merge Worker
Browse files

Merge "Smartspace - Support Do Not Disturb" into sc-dev am: 8ddca3c6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14421939

Change-Id: I558360f259e00af2ef4299ddc9c2a4728780b408
parents b05c06a0 8ddca3c6
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -20,10 +20,13 @@ import android.app.PendingIntent;
import android.app.smartspace.SmartspaceAction;
import android.app.smartspace.SmartspaceTarget;
import android.content.Intent;
import android.graphics.drawable.Icon;
import android.os.Parcelable;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;

import com.android.systemui.plugins.annotations.ProvidesInterface;

import java.util.List;
@@ -50,6 +53,11 @@ public interface BcSmartspaceDataPlugin extends Plugin {
        return null;
    }

    /**
     * As the smartspace view becomes available, allow listeners to receive an event.
     */
    default void addOnAttachStateChangeListener(View.OnAttachStateChangeListener listener) { }

    /** Updates Smartspace data and propagates it to any listeners. */
    void onTargetsAvailable(List<SmartspaceTarget> targets);

@@ -83,6 +91,11 @@ public interface BcSmartspaceDataPlugin extends Plugin {
         * When on the lockscreen, use the FalsingManager to help detect errant touches
         */
        void setFalsingManager(com.android.systemui.plugins.FalsingManager falsingManager);

        /**
         * Set or clear any Do Not Disturb information.
         */
        void setDnd(@Nullable Icon dndIcon, @Nullable String description);
    }

    /** Interface for launching Intents, which can differ on the lockscreen */
+1 −1
Original line number Diff line number Diff line
@@ -80,6 +80,6 @@
        android:layout_width="match_parent"
        android:layout_height="@dimen/notification_shelf_height"
        android:layout_below="@id/keyguard_status_area"
        android:paddingStart="@dimen/below_clock_padding_start"
        android:paddingStart="@dimen/below_clock_padding_start_extra"
    />
</com.android.keyguard.KeyguardClockSwitch>
+1 −0
Original line number Diff line number Diff line
@@ -94,4 +94,5 @@
    <!-- additional offset for clock switch area items -->
    <dimen name="clock_padding_start">28dp</dimen>
    <dimen name="below_clock_padding_start">32dp</dimen>
    <dimen name="below_clock_padding_start_extra">36dp</dimen>
</resources>
+7 −7
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ import com.android.internal.colorextraction.ColorExtractor;
import com.android.keyguard.clock.ClockManager;
import com.android.settingslib.Utils;
import com.android.systemui.R;
import com.android.systemui.SystemUIFactory;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.dagger.qualifiers.Main;
@@ -69,6 +68,7 @@ import com.android.systemui.util.ViewController;
import com.android.systemui.util.settings.SecureSettings;

import java.util.Locale;
import java.util.Optional;
import java.util.TimeZone;
import java.util.concurrent.Executor;

@@ -89,7 +89,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
    private final Executor mUiExecutor;
    private final BatteryController mBatteryController;
    private final FeatureFlags mFeatureFlags;
    private final SystemUIFactory mSystemUIFactory;

    /**
     * Clock for both small and large sizes
@@ -152,6 +151,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS

    // If set, will replace keyguard_status_area
    private BcSmartspaceDataPlugin.SmartspaceView mSmartspaceView;
    private Optional<BcSmartspaceDataPlugin> mSmartspacePlugin;

    @Inject
    public KeyguardClockSwitchController(
@@ -165,14 +165,14 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
            @Main Executor uiExecutor,
            BatteryController batteryController,
            ConfigurationController configurationController,
            SystemUIFactory systemUIFactory,
            ActivityStarter activityStarter,
            FalsingManager falsingManager,
            KeyguardUpdateMonitor keyguardUpdateMonitor,
            KeyguardBypassController bypassController,
            @Main Handler handler,
            UserTracker userTracker,
            SecureSettings secureSettings) {
            SecureSettings secureSettings,
            Optional<BcSmartspaceDataPlugin> smartspacePlugin) {
        super(keyguardClockSwitch);
        mStatusBarStateController = statusBarStateController;
        mColorExtractor = colorExtractor;
@@ -184,7 +184,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
        mUiExecutor = uiExecutor;
        mBatteryController = batteryController;
        mConfigurationController = configurationController;
        mSystemUIFactory = systemUIFactory;
        mActivityStarter = activityStarter;
        mFalsingManager = falsingManager;
        mKeyguardUpdateMonitor = keyguardUpdateMonitor;
@@ -192,6 +191,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
        mHandler = handler;
        mUserTracker = userTracker;
        mSecureSettings = secureSettings;
        mSmartspacePlugin = smartspacePlugin;
    }

    /**
@@ -237,8 +237,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
        mStatusBarStateController.addCallback(mStatusBarStateListener);
        mConfigurationController.addCallback(mConfigurationListener);

        BcSmartspaceDataPlugin smartspaceDataPlugin = mSystemUIFactory.getSmartspaceDataProvider();
        if (mFeatureFlags.isSmartspaceEnabled() && smartspaceDataPlugin != null) {
        if (mFeatureFlags.isSmartspaceEnabled() && mSmartspacePlugin.isPresent()) {
            BcSmartspaceDataPlugin smartspaceDataPlugin = mSmartspacePlugin.get();
            View ksa = mView.findViewById(R.id.keyguard_status_area);
            int ksaIndex = mView.indexOfChild(ksa);
            ksa.setVisibility(View.GONE);
+0 −5
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import com.android.systemui.dagger.GlobalRootComponent;
import com.android.systemui.dagger.SysUIComponent;
import com.android.systemui.dagger.WMComponent;
import com.android.systemui.navigationbar.gestural.BackGestureTfClassifierProvider;
import com.android.systemui.plugins.BcSmartspaceDataPlugin;
import com.android.systemui.screenshot.ScreenshotNotificationSmartActionsProvider;
import com.android.wm.shell.transition.Transitions;

@@ -210,8 +209,4 @@ public class SystemUIFactory {
            AssetManager am, String modelName) {
        return new BackGestureTfClassifierProvider();
    }

    public BcSmartspaceDataPlugin getSmartspaceDataProvider() {
        return null;
    }
}
Loading