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

Commit 54daefe3 authored by Anthony Chen's avatar Anthony Chen
Browse files

Use custom QS fragment for auto use-case.

Use a custom QS fragment if the UI mode is car. This fragment disables
the quick settings row and expansion. Remove the config options that
used to have disabled this in the phone QSFragment.

To accomplish this, introduce a new QSFooter interface. The old
QSFooter.java now implements this.

Test: boot on phone and Android Auto headunit
Bug: 33210494
Change-Id: I5accc2d27d6725380ca5e271d332a03991c9419b
parent cbbb27bc
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -31,9 +31,9 @@ import com.android.systemui.plugins.qs.QS.HeightListener;
@DependsOn(target = HeightListener.class)
public interface QS extends FragmentBase {

    public static final String ACTION = "com.android.systemui.action.PLUGIN_QS";
    String ACTION = "com.android.systemui.action.PLUGIN_QS";

    public static final int VERSION = 6;
    int VERSION = 6;

    String TAG = "QS";

@@ -66,8 +66,8 @@ public interface QS extends FragmentBase {
    }

    @ProvidesInterface(version = HeightListener.VERSION)
    public interface HeightListener {
        public static final int VERSION = 1;
    interface HeightListener {
        int VERSION = 1;
        void onQsHeightChanged();
    }

+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android">
    <shape>
        <solid android:color="?android:attr/colorPrimaryDark"/>
    </shape>
</inset>
+63 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!-- extends RelativeLayout -->
<com.android.systemui.qs.car.CarQSFooter
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/qs_footer"
    android:layout_width="match_parent"
    android:layout_height="@dimen/qs_footer_height"
    android:baselineAligned="false"
    android:clickable="false"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:paddingBottom="16dp"
    android:paddingTop="16dp"
    android:paddingEnd="32dp"
    android:paddingStart="32dp"
    android:gravity="center_vertical"
    android:orientation="horizontal">

    <com.android.systemui.statusbar.phone.MultiUserSwitch
        android:id="@+id/multi_user_switch"
        android:layout_alignParentStart="true"
        android:layout_centerVertical="true"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:background="@drawable/ripple_drawable"
        android:focusable="true">

        <ImageView
            android:id="@+id/multi_user_avatar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:scaleType="centerInside"/>
    </com.android.systemui.statusbar.phone.MultiUserSwitch>

    <com.android.systemui.statusbar.phone.SettingsButton
        android:id="@+id/settings_button"
        android:layout_alignParentEnd="true"
        android:layout_centerVertical="true"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:background="@drawable/ripple_drawable"
        android:contentDescription="@string/accessibility_quick_settings_settings"
        android:scaleType="centerCrop"
        android:src="@drawable/ic_settings_16dp"
        android:tint="?android:attr/colorForeground"
        style="@android:style/Widget.Material.Button.Borderless" />

</com.android.systemui.qs.car.CarQSFooter>
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/quick_settings_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/car_qs_background_primary"
    android:orientation="vertical"
    android:elevation="4dp">

    <include layout="@layout/car_status_bar_header" />
    <include layout="@layout/car_qs_footer" />
</LinearLayout>
+44 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!-- Extends RelativeLayout -->
<com.android.systemui.qs.car.CarStatusBarHeader
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:id="@+id/header"
    android:layout_width="match_parent"
    android:layout_height="@dimen/car_qs_header_system_icons_area_height"
    android:paddingStart="8dp"
    android:paddingEnd="8dp" >

    <include
        layout="@layout/system_icons"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_alignParentStart="true"
        android:layout_centerVertical="true" />

    <com.android.systemui.statusbar.policy.Clock
        android:id="@+id/clock"
        android:textAppearance="@style/TextAppearance.StatusBar.Clock"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_alignParentEnd="true"
        android:layout_centerVertical="true"
        android:singleLine="true"
        android:paddingStart="@dimen/status_bar_clock_starting_padding"
        android:paddingEnd="@dimen/status_bar_clock_end_padding"
        systemui:showDark="false" />
</com.android.systemui.qs.car.CarStatusBarHeader>
Loading