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

Commit 9019ff2d authored by Joel Galenson's avatar Joel Galenson
Browse files

Add a dialog showing the enabled accessibility services.

It shows the enabled accessibility services and their last access
time.  If there's only one such service we show a slightly different
dialog.

Bug: 123595964
Test: View dialog with one and two enabled services.
Change-Id: I37a74880ebd99184c51a88a3dbc4740e8691138c
parent 042cd43a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -128,6 +128,15 @@
                android:excludeFromRecents="true"
                android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar" />

        <activity android:name="com.android.packageinstaller.permission.ui.ReviewAccessibilityServicesActivity"
                  android:excludeFromRecents="true"
                  android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar" >
            <intent-filter android:priority="1">
                <action android:name="android.intent.action.REVIEW_ACCESSIBILITY_SERVICES" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name="com.android.packageinstaller.role.ui.RequestRoleActivity"
                  android:excludeFromRecents="true"
                  android:theme="@style/RequestRole">
+92 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2019 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.
-->

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fillViewport ="true"
            android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/accessibility_service_dialog_text_margin_top_bottom"
            android:gravity="center" >

            <ImageView
                android:id="@+id/header_icon"
                android:layout_height="@dimen/accessibility_service_dialog_app_icon_size"
                android:layout_width="@dimen/accessibility_service_dialog_app_icon_size"
                android:scaleType="fitCenter"
                android:visibility="gone" />

        </LinearLayout>

        <TextView
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:textAppearance="@android:style/TextAppearance.Material.Title"
            android:layout_marginStart="@dimen/accessibility_service_dialog_text_margin_sides"
            android:layout_marginEnd="@dimen/accessibility_service_dialog_text_margin_sides"
            android:layout_marginTop="@dimen/accessibility_service_dialog_text_margin_top_bottom"
            android:layout_marginBottom="@dimen/accessibility_service_dialog_text_margin_top_bottom" />

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <LinearLayout
                android:id="@+id/items_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:gravity="start" />

        </LinearLayout>

        <TextView
            android:id="@+id/middle_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:layout_marginStart="@dimen/accessibility_service_dialog_text_margin_sides"
            android:layout_marginEnd="@dimen/accessibility_service_dialog_text_margin_sides"
            android:layout_marginTop="@dimen/accessibility_service_dialog_text_margin_top_bottom"
            android:layout_marginBottom="@dimen/accessibility_service_dialog_text_margin_top_bottom"
            android:visibility="gone" />

        <TextView
            android:id="@+id/bottom_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:layout_marginStart="@dimen/accessibility_service_dialog_text_margin_sides"
            android:layout_marginEnd="@dimen/accessibility_service_dialog_text_margin_sides"
            android:layout_marginTop="@dimen/accessibility_service_dialog_text_margin_top_bottom"
            android:layout_marginBottom="@dimen/accessibility_service_dialog_text_margin_top_bottom" />

    </LinearLayout>

</ScrollView>
+65 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2019 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:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginStart="@dimen/accessibility_service_dialog_text_margin_sides"
              android:layout_marginEnd="@dimen/accessibility_service_dialog_text_margin_sides"
              android:orientation="horizontal"
              android:layout_gravity="center_vertical">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="start|center_vertical" >

        <ImageView
            android:id="@+id/icon"
            android:layout_height="@dimen/accessibility_service_dialog_app_icon_size"
            android:layout_width="@dimen/accessibility_service_dialog_app_icon_size"
            android:scaleType="fitCenter" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_marginStart="@dimen/accessibility_service_dialog_text_padding"
        android:orientation="vertical"
        android:paddingTop="16dp"
        android:paddingBottom="16dp" >

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceListItem"
            android:ellipsize="marquee" />

        <TextView
            android:id="@+id/summary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceListItemSecondary"
            android:textColor="?android:attr/textColorSecondary" />

    </LinearLayout>

</LinearLayout>
+5 −0
Original line number Diff line number Diff line
@@ -56,4 +56,9 @@

    <dimen name="preference_usage_title_summary_icon_size">16dp</dimen>

    <dimen name="accessibility_service_dialog_text_margin_sides">24dp</dimen>
    <dimen name="accessibility_service_dialog_text_margin_top_bottom">18dp</dimen>
    <dimen name="accessibility_service_dialog_app_icon_size">32dp</dimen>
    <dimen name="accessibility_service_dialog_text_padding">16dp</dimen>

</resources>
+15 −0
Original line number Diff line number Diff line
@@ -470,6 +470,21 @@
    <!-- Label for button that allows user to force stop the app [CHAR LIMIT=25] -->
    <string name="force_stop_app">Force stop</string>

    <!-- Label for button that opens up the Settings [CHAR LIMIT=20] -->
    <string name="settings">Settings</string>

    <!-- Title for the dialog listing the enabled accessibility services when there is only one [CHAR LIMIT=none] -->
    <string name="accessibility_service_dialog_title_single"><xliff:g id="service_name" example="Gmail">%s</xliff:g> has full access to your device</string>

    <!-- Title for the dialog listing the enabled accessibility services when there are more than one [CHAR LIMIT=none] -->
    <string name="accessibility_service_dialog_title_multiple"><xliff:g id="num_services" example="2">%s</xliff:g> accessibility services have full access to your device</string>

    <!-- Text for the dialog listing the enabled accessibility services when there is only one [CHAR LIMIT=none] -->
    <string name="accessibility_service_dialog_bottom_text_single"><xliff:g id="service_name" example="Gmail">%s</xliff:g> can view your screen, actions, and inputs, perform actions, and control the display.</string>

    <!-- Text for the dialog listing the enabled accessibility services when there are more than one [CHAR LIMIT=none] -->
    <string name="accessibility_service_dialog_bottom_text_multiple">These services can view your screen, actions, and inputs, perform actions, and control the display.</string>

    <!-- Title for page of managing default apps. [CHAR LIMIT=30] -->
    <string name="default_apps">Default apps</string>

Loading