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

Commit a9287f5b authored by Priyanka Advani's avatar Priyanka Advani Committed by Android (Google) Code Review
Browse files

Revert "[SB][Sat] Add demo repo for device-based satellite."

This reverts commit cdcd587f.

Reason for revert: Build breakage in b/336843178. 

Change-Id: I3a29e3b1f7bdede233ec8142848a4c5dc830cf38
parent cdcd587f
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import com.android.systemui.statusbar.StatusIconDisplayable;
import com.android.systemui.statusbar.pipeline.mobile.ui.MobileViewLogger;
import com.android.systemui.statusbar.pipeline.mobile.ui.view.ModernStatusBarMobileView;
import com.android.systemui.statusbar.pipeline.mobile.ui.viewmodel.MobileIconsViewModel;
import com.android.systemui.statusbar.pipeline.shared.ui.view.ModernStatusBarView;
import com.android.systemui.statusbar.pipeline.wifi.ui.view.ModernStatusBarWifiView;
import com.android.systemui.statusbar.pipeline.wifi.ui.viewmodel.LocationBasedWifiViewModel;

@@ -278,15 +277,6 @@ public class DemoStatusIcons extends StatusIconContainer implements DemoMode, Da
        addView(view, viewIndex, createLayoutParams());
    }

    /** Adds a bindable icon to the demo mode view. */
    public void addBindableIcon(StatusBarIconHolder.BindableIconHolder holder) {
        // This doesn't do any correct ordering, and also doesn't check if we already have an
        // existing icon for the slot. But since we hope to remove this class soon, we won't spend
        // the time adding that logic.
        ModernStatusBarView view = holder.getInitializer().createAndBind(mContext);
        addView(view, createLayoutParams());
    }

    public void onRemoveIcon(StatusIconDisplayable view) {
        if (view.getSlot().equals("wifi")) {
            if (view instanceof ModernStatusBarWifiView) {
+1 −14
Original line number Diff line number Diff line
@@ -54,9 +54,7 @@ import com.android.systemui.statusbar.pipeline.wifi.ui.viewmodel.LocationBasedWi
import com.android.systemui.util.Assert;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.inject.Inject;

@@ -350,11 +348,7 @@ public interface StatusBarIconController {
        private final MobileContextProvider mMobileContextProvider;
        private final LocationBasedWifiViewModel mWifiViewModel;
        private final MobileIconsViewModel mMobileIconsViewModel;
        /**
         * Stores the list of bindable icons that have been added, keyed on slot name. This ensures
         * we don't accidentally add the same bindable icon twice.
         */
        private final Map<String, BindableIconHolder> mBindableIcons = new HashMap<>();

        protected final Context mContext;
        protected int mIconSize;
        // Whether or not these icons show up in dumpsys
@@ -466,12 +460,8 @@ public interface StatusBarIconController {
         * ViewBinder to control its visual state.
         */
        protected StatusIconDisplayable addBindableIcon(BindableIconHolder holder, int index) {
            mBindableIcons.put(holder.getSlot(), holder);
            ModernStatusBarView view = holder.getInitializer().createAndBind(mContext);
            mGroup.addView(view, index, onCreateLayoutParams());
            if (mIsInDemoMode) {
                mDemoStatusIcons.addBindableIcon(holder);
            }
            return view;
        }

@@ -582,9 +572,6 @@ public interface StatusBarIconController {
            if (mDemoStatusIcons == null) {
                mDemoStatusIcons = createDemoStatusIcons();
                mDemoStatusIcons.addModernWifiView(mWifiViewModel);
                for (BindableIconHolder holder : mBindableIcons.values()) {
                    mDemoStatusIcons.addBindableIcon(holder);
                }
            }
            mDemoStatusIcons.onDemoModeStarted();
        }
+1 −2
Original line number Diff line number Diff line
@@ -212,8 +212,7 @@ public class StatusBarIconControllerImpl implements Tunable,
        StatusBarIconHolder existingHolder = mStatusBarIconList.getIconHolder(icon.getSlot(), 0);
        // Expected to be null
        if (existingHolder == null) {
            BindableIconHolder bindableIcon =
                    new BindableIconHolder(icon.getInitializer(), icon.getSlot());
            BindableIconHolder bindableIcon = new BindableIconHolder(icon.getInitializer());
            setIcon(icon.getSlot(), bindableIcon);
        } else {
            Log.e(TAG, "addBindableIcon called, but icon has already been added. Ignoring");
+3 −6
Original line number Diff line number Diff line
@@ -169,19 +169,16 @@ open class StatusBarIconHolder private constructor() {
     * StatusBarIconController will register all available bindable icons on init (see
     * [BindableIconsRepository]), and will ignore any call to setIcon for these.
     *
     * @property initializer a view creator that can bind the relevant view models to the created
     *   view.
     * @property slot the name of the slot that this holder is used for.
     * [initializer] a view creator that can bind the relevant view models to the created view.
     */
    class BindableIconHolder(val initializer: ModernStatusBarViewCreator, val slot: String) :
        StatusBarIconHolder() {
    class BindableIconHolder(val initializer: ModernStatusBarViewCreator) : StatusBarIconHolder() {
        override var type: Int = TYPE_BINDABLE

        /** This is unused, as bindable icons use their own view binders to control visibility */
        override var isVisible: Boolean = true

        override fun toString(): String {
            return ("StatusBarIconHolder(type=BINDABLE, slot=$slot)")
            return ("StatusBarIconHolder(type=BINDABLE)")
        }
    }
}
+1 −8
Original line number Diff line number Diff line
@@ -41,8 +41,6 @@ import com.android.systemui.statusbar.pipeline.mobile.util.MobileMappingsProxyIm
import com.android.systemui.statusbar.pipeline.mobile.util.SubscriptionManagerProxy
import com.android.systemui.statusbar.pipeline.mobile.util.SubscriptionManagerProxyImpl
import com.android.systemui.statusbar.pipeline.satellite.data.DeviceBasedSatelliteRepository
import com.android.systemui.statusbar.pipeline.satellite.data.DeviceBasedSatelliteRepositorySwitcher
import com.android.systemui.statusbar.pipeline.satellite.data.RealDeviceBasedSatelliteRepository
import com.android.systemui.statusbar.pipeline.satellite.data.prod.DeviceBasedSatelliteRepositoryImpl
import com.android.systemui.statusbar.pipeline.shared.data.repository.ConnectivityRepository
import com.android.systemui.statusbar.pipeline.shared.data.repository.ConnectivityRepositoryImpl
@@ -82,14 +80,9 @@ abstract class StatusBarPipelineModule {
    @Binds
    abstract fun connectivityRepository(impl: ConnectivityRepositoryImpl): ConnectivityRepository

    @Binds
    abstract fun realDeviceBasedSatelliteRepository(
        impl: DeviceBasedSatelliteRepositoryImpl
    ): RealDeviceBasedSatelliteRepository

    @Binds
    abstract fun deviceBasedSatelliteRepository(
        impl: DeviceBasedSatelliteRepositorySwitcher
        impl: DeviceBasedSatelliteRepositoryImpl
    ): DeviceBasedSatelliteRepository

    @Binds abstract fun wifiRepository(impl: WifiRepositorySwitcher): WifiRepository
Loading