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

Commit 5473915e authored by davidln's avatar davidln
Browse files

Remove demo HVAC property in favor of using the emulated VHAL.

The use of this feature is redundant with the emulated VHAL. It is also HVAC specific which does not align well with the future design of accessing car properties. When testing/mocking for a specific property is needed, it is preferable that this is injected at a lower level.

Bug: 110105682

Test: build and deploy
Change-Id: I615e899e1dcefdd421f50a2112735404d4d248e8
parent 1ff73729
Loading
Loading
Loading
Loading
+20 −18
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.app.ActivityManager;
import android.app.ActivityTaskManager;
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;
import android.os.SystemProperties;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
@@ -51,14 +50,13 @@ import com.android.systemui.statusbar.policy.UserSwitcherController;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.Map;

/**
 * A status bar (and navigation bar) tailored for the automotive use case.
 */
public class CarStatusBar extends StatusBar implements
        CarBatteryController.BatteryViewHandler {
    private static final String TAG = "CarStatusBar";
    public static final boolean ENABLE_HVAC_CONNECTION
            = !SystemProperties.getBoolean("android.car.hvac.demo", true);

    private TaskStackListenerImpl mTaskStackListener;

@@ -97,10 +95,9 @@ public class CarStatusBar extends StatusBar implements
        createBatteryController();
        mCarBatteryController.startListening();

        if (ENABLE_HVAC_CONNECTION) {
        Log.d(TAG, "Connecting to HVAC service");
        Dependency.get(HvacController.class).connectToCarService();
        }

        mCarFacetButtonController = Dependency.get(CarFacetButtonController.class);
        mDeviceProvisionedController = Dependency.get(DeviceProvisionedController.class);
        mDeviceIsProvisioned = mDeviceProvisionedController.isDeviceProvisioned();
@@ -123,9 +120,9 @@ public class CarStatusBar extends StatusBar implements
     */
    private void restartNavBars() {
        mCarFacetButtonController.removeAll();
        if (ENABLE_HVAC_CONNECTION) {

        Dependency.get(HvacController.class).removeAllComponents();
        }

        if (mNavigationBarWindow != null) {
            mNavigationBarWindow.removeAllViews();
            mNavigationBarView = null;
@@ -378,10 +375,12 @@ public class CarStatusBar extends StatusBar implements
                    + "," + mStackScroller.getScrollY());
        }

        pw.print("  mTaskStackListener="); pw.println(mTaskStackListener);
        pw.print("  mTaskStackListener=");
        pw.println(mTaskStackListener);
        pw.print("  mCarFacetButtonController=");
        pw.println(mCarFacetButtonController);
        pw.print("  mFullscreenUserSwitcher="); pw.println(mFullscreenUserSwitcher);
        pw.print("  mFullscreenUserSwitcher=");
        pw.println(mFullscreenUserSwitcher);
        pw.print("  mCarBatteryController=");
        pw.println(mCarBatteryController);
        pw.print("  mBatteryMeterView=");
@@ -400,7 +399,10 @@ public class CarStatusBar extends StatusBar implements

        pw.println("SharedPreferences:");
        for (Map.Entry<String, ?> entry : Prefs.getAll(mContext).entrySet()) {
            pw.print("  "); pw.print(entry.getKey()); pw.print("="); pw.println(entry.getValue());
            pw.print("  ");
            pw.print(entry.getKey());
            pw.print("=");
            pw.println(entry.getValue());
        }
    }

@@ -446,8 +448,8 @@ public class CarStatusBar extends StatusBar implements
    }

    /**
     * An implementation of SysUiTaskStackChangeListener, that listens for changes in the system task
     * stack and notifies the navigation bar.
     * An implementation of SysUiTaskStackChangeListener, that listens for changes in the system
     * task stack and notifies the navigation bar.
     */
    private class TaskStackListenerImpl extends SysUiTaskStackChangeListener {
        @Override