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

Commit 3c40fff6 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Add dialog and controller for TileServiceRequest

This adds the SystemUI side. As there's no API, it's triggered using
CommandRegistry and outputs response to logcat.

The design of the dialog is not final, so measures and styles will be
changed in a future CL.

Test: atest TileRequestDialogTest TileServiceRequestControllerTest
Test: manual
Fixes: 196056024

Change-Id: I5a52b7cd9db6a7fc79a8751e7702be8c005b8def
parent 62962cb7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -60,6 +60,10 @@ public abstract class QSTileView extends LinearLayout {

    public abstract int getDetailY();

    public View getLabel() {
        return null;
    }

    public View getLabelContainer() {
        return null;
    }
+36 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2021 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/content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:gravity="center_horizontal"
>
    <TextView
        android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="16dp"
        android:textDirection="locale"
        android:textAlignment="viewStart"
        android:textAppearance="@style/TextAppearance.PrivacyDialog"
        android:lineHeight="20sp"
    />
</LinearLayout>
+4 −0
Original line number Diff line number Diff line
@@ -1636,4 +1636,8 @@
    <item name="communal_source_height_percentage" format="float" type="dimen">0.80</item>

    <dimen name="drag_and_drop_icon_size">70dp</dimen>

    <dimen name="qs_tile_service_request_dialog_width">304dp</dimen>
    <dimen name="qs_tile_service_request_tile_width">192dp</dimen>
    <dimen name="qs_tile_service_request_content_space">24dp</dimen>
</resources>
+8 −0
Original line number Diff line number Diff line
@@ -3022,4 +3022,12 @@
    <string name="wifi_failed_connect_message">Failed to connect to network</string>
    <!-- Provider Model: Title to see all the networks [CHAR LIMIT=50] -->
    <string name="see_all_networks">See all</string>

    <!-- Text for TileService request dialog. This is shown to the user that an app is requesting
         user approval to add the shown tile to Quick Settings [CHAR LIMIT=NONE] -->
    <string name="qs_tile_request_dialog_text"><xliff:g id="appName" example="Fake App">%1$s</xliff:g> wants to add the following tile to Quick Settings</string>
    <!-- Text for TileService request dialog. Text for button for user to approve adding the tile [CHAR LIMIT=20] -->
    <string name="qs_tile_request_dialog_add">Add tile</string>
    <!-- Text for TileService request dialog. Text for button for user to reject adding the tile [CHAR LIMIT=20] -->
    <string name="qs_tile_request_dialog_not_add">Do not add tile</string>
</resources>
+10 −0
Original line number Diff line number Diff line
@@ -727,6 +727,16 @@
        <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
    </style>

    <!-- TileService request dialog -->
    <style name="TileRequestDialog" parent="Theme.SystemUI.QuickSettings.Dialog">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@drawable/qs_dialog_bg</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:windowCloseOnTouchOutside">true</item>
        <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
    </style>

    <!-- USB Contaminant dialog -->
    <style name ="USBContaminant" />

Loading