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

Commit 00951987 authored by Evan Chen's avatar Evan Chen
Browse files

Introduce vendor header for selfManaged dialog

Test: Test: atest CtsCompanionDeviceManagerCoreTestCases
      atest CtsCompanionDeviceManagerUiAutomationTestCases
      atest CtsOsTestCases:CompanionDeviceManagerTest
Bug: 216638097
Change-Id: Ib73b17c81bf9ac0cc7a98459cffbd9a233c9fbe5
parent 9e16ca47
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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.
  -->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
    <solid android:color="@android:color/system_accent1_100"/>
    <corners android:topLeftRadius="16dp" android:topRightRadius="16dp"
             android:bottomLeftRadius="16dp" android:bottomRightRadius="16dp"/>
</shape>
 No newline at end of file
+7 −11
Original line number Diff line number Diff line
@@ -15,14 +15,10 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/activity_confirmation"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:background="@drawable/dialog_background"
              android:elevation="16dp"
              android:maxHeight="400dp"
              android:orientation="vertical"
              android:padding="18dp"
              android:layout_gravity="center">
              style="@style/ContainerLayout">

    <!-- A header for selfManaged devices only. -->
    <include layout="@layout/vendor_header" />

    <!-- Do NOT change the ID of the root LinearLayout above: it's referenced in CTS tests. -->

@@ -51,8 +47,8 @@

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/device_list"
                style="@android:style/Widget.Material.ListView"
            android:layout_width="match_parent"
            android:scrollbars="vertical"
            android:layout_height="200dp" />

    </RelativeLayout>
+63 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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/helper_confirmation"
              android:theme="@style/ChooserActivity"
              style="@style/ContainerLayout">

    <ImageView
        android:id="@+id/app_icon"
        android:layout_width="match_parent"
        android:layout_height="32dp"
        android:gravity="center"
        android:layout_marginBottom="12dp"
        android:layout_marginTop="1dp"/>

    <TextView
        android:id="@+id/helper_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:paddingHorizontal="12dp"
        style="@*android:style/TextAppearance.Widget.Toolbar.Title"
        android:textSize="20sp" />

    <TextView
        android:id="@+id/helper_summary"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="12dp"
        android:layout_marginLeft="20dp"
        android:layout_marginBottom="24dp"
        android:gravity="start"
        android:textColor="?android:attr/textColorSecondary"
        android:textSize="14sp" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="end">

        <Button
            android:id="@+id/btn_ok"
            style="@style/VendorHelperOkButton"
            android:text="@string/consent_ok" />

    </LinearLayout>

</LinearLayout>
+48 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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.
  -->

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/vendor_header"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_gravity="center"
    android:layout_marginBottom="16dp"
    android:visibility="gone" >

    <ImageView
        android:id="@+id/vendor_header_image"
        android:layout_width="31dp"
        android:layout_height="32dp" />

    <TextView
        android:id="@+id/vendor_header_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginTop="5dp"
        android:layout_toRightOf="@+id/header_image" />

    <ImageButton
        android:id="@+id/vendor_header_button"
        style="?android:attr/actionOverflowButtonStyle"
        android:layout_width="31dp"
        android:layout_height="32dp"
        android:layout_marginLeft="100dp"
        android:layout_alignParentRight="true" />

</RelativeLayout>
 No newline at end of file
+19 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@
    <!-- ================= DEVICE_PROFILE_APP_STREAMING ================= -->

    <!-- Confirmation for associating an application with a companion device of APP_STREAMING profile (type) [CHAR LIMIT=NONE] -->
    <string name="title_app_streaming">Allow &lt;strong&gt;<xliff:g id="app_name" example="Exo">%1$s</xliff:g>&lt;/strong&gt; to stream applications?</string>
    <string name="title_app_streaming">Allow &lt;strong&gt;<xliff:g id="app_name" example="Exo">%1$s</xliff:g>&lt;/strong&gt; to access this information for your phone</string>

    <!-- Description of the privileges the application will get if associated with the companion device of APP_STREAMING profile (type) [CHAR LIMIT=NONE] -->
    <string name="summary_app_streaming" product="default">Let &lt;strong&gt;<xliff:g id="app_name" example="Exo">%1$s</xliff:g>&lt;/strong&gt; to provide &lt;strong&gt;<xliff:g id="device_name" example="Pixelbook Go">%2$s</xliff:g>&lt;/strong&gt; remote access to access to applications installed on this phone when connected.</string>
@@ -50,6 +50,12 @@
    <!-- Description of the privileges the application will get if associated with the companion device of APP_STREAMING profile (type) [CHAR LIMIT=NONE] -->
    <string name="summary_app_streaming" product="device">Let &lt;strong&gt;<xliff:g id="app_name" example="Exo">%1$s</xliff:g>&lt;/strong&gt; to provide &lt;strong&gt;<xliff:g id="device_name" example="Pixelbook Go">%2$s</xliff:g>&lt;/strong&gt; remote access to access to applications installed on this device when connected.</string>

    <!-- Title of the helper dialog for APP_STREAMING profile [CHAR LIMIT=30]. -->
    <string name="helper_title_app_streaming">Cross-device services</string>

    <!-- Description of the helper dialog for APP_STREAMING profile. [CHAR LIMIT=NONE] -->
    <string name="helper_summary_app_streaming">This service is used to stream apps between your devices</string>

    <!-- ================= DEVICE_PROFILE_AUTOMOTIVE_PROJECTION ================= -->

    <!-- Confirmation for associating an application with a companion device of AUTOMOTIVE_PROJECTION profile (type) [CHAR LIMIT=NONE] -->
@@ -66,6 +72,15 @@
    <!-- Description of the privileges the application will get if associated with the companion device of COMPUTER profile (type) [CHAR LIMIT=NONE] -->
    <string name="summary_computer"></string>

    <!-- Title of the helper dialog for COMPUTER profile [CHAR LIMIT=30]. -->
    <string name="helper_title_computer">Google Play services</string>

    <!-- Description of the helper dialog for COMPUTER profile. [CHAR LIMIT=NONE] -->
    <string name="helper_summary_computer" product="default">This service shares photos, media, and notifications form your phone to other devices</string>

    <!-- Description of the helper dialog for COMPUTER profile. [CHAR LIMIT=NONE] -->
    <string name="helper_summary_computer" product="tablet">This service shares photos, media, and notifications form your phone to other devices</string>

    <!-- ================= null profile ================= -->

    <!-- A noun for a companion device with unspecified profile (type) [CHAR LIMIT=30] -->
@@ -82,6 +97,9 @@
    <!-- Negative button for the device-app association consent dialog [CHAR LIMIT=30] -->
    <string name="consent_no">Don\u2019t allow</string>

    <!-- Ok button for the helper consent dialog [CHAR LIMIT=30] -->
    <string name="consent_ok">OK</string>

    <!-- ================== System data transfer ==================== -->
    <!-- Title of the permission sync confirmation dialog. [CHAR LIMIT=60] -->
    <string name="permission_sync_confirmation_title">Transfer app permissions to your
Loading