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

Commit 31c58cbb authored by Joel Galenson's avatar Joel Galenson
Browse files

Migrate the ongoing usage dialog from SysUI.

Fixes: 128690096
Test: Open dialog with various apps/permissions in use.
Change-Id: I55c39795ea4787e751da2ef3ae6db8398e15acf0
parent a12c0979
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -141,6 +141,16 @@
                  android:excludeFromRecents="true"
                  android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar" />

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

        <activity android:name="com.android.packageinstaller.permission.ui.ReviewAccessibilityServicesActivity"
                  android:excludeFromRecents="true"
                  android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar"
+45 −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:id="@+id/container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            style="@style/PermissionUsageDialogContainerScrollView">

    <LinearLayout
        android:id="@+id/dialog_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        style="@style/PermissionUsageDialogContainerLayout">

        <TextView
            android:id="@+id/title"
            style="@style/PermissionUsageDialogTitle"/>

        <LinearLayout
            style="@style/PermissionUsageDialogItemsContainerLayout">

            <LinearLayout
                android:id="@+id/items_container"
                style="@style/PermissionUsageDialogItemsContainer"/>

        </LinearLayout>

    </LinearLayout>

</ScrollView>
+38 −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"
    style="@style/PermissionUsageDialogItemContainer">

    <FrameLayout
        style="@style/PermissionUsageDialogItemIconFrame">

        <ImageView
            android:id="@+id/app_icon"
            style="@style/PermissionUsageDialogItemIcon"/>

    </FrameLayout>

    <TextView
        android:id="@+id/app_name"
        style="@style/PermissionUsageDialogItemAppName"/>

    <LinearLayout
        android:id="@+id/icons"
        style="@style/PermissionUsageDialogItemIconsContainer"/>

</LinearLayout>
+13 −0
Original line number Diff line number Diff line
@@ -99,6 +99,19 @@
            <item type="style" name="GrandfatheredModernStorageGroupWarningDialogTitleMessage" />
            <!-- END GRANDFATHERED MODERN STORAGE GROUP WARNING DIALOG -->

            <!-- START ONGOING USAGE DIALOG -->
            <item type="style" name="PermissionUsageDialogContainerScrollView" />
            <item type="style" name="PermissionUsageDialogContainerLayout" />
            <item type="style" name="PermissionUsageDialogTitle" />
            <item type="style" name="PermissionUsageDialogItemsContainerLayout" />
            <item type="style" name="PermissionUsageDialogItemsContainer" />

            <item type="style" name="PermissionUsageDialogItemContainer" />
            <item type="style" name="PermissionUsageDialogItemIconFrame" />
            <item type="style" name="PermissionUsageDialogItemIcon" />
            <item type="style" name="PermissionUsageDialogItemAppName" />
            <item type="style" name="PermissionUsageDialogItemIconsContainer" />
            <!-- END ONGOING USAGE DIALOG -->
        </policy>

    </overlayable>
+15 −0
Original line number Diff line number Diff line
@@ -526,6 +526,21 @@
    <!-- Keyword in the Settings app's search functionality that can be used to find links to the default app management screens [CHAR LIMIT=none] -->
    <string name="default_app_search_keyword">default apps</string>

    <!-- Action for accepting the Ongoing usage dialog [CHAR LIMIT=10]-->
    <string name="ongoing_usage_dialog_ok">Got it</string>

    <!-- Action on Ongoing usage dialog to open the Privacy settings. [CHAR LIMIT=23]-->
    <string name="ongoing_usage_dialog_open_settings">Privacy settings</string>

    <!-- Title for Ongoing usage dialog title when multiple apps are using app ops [CHAR LIMIT=NONE] -->
    <string name="ongoing_usage_dialog_title">Apps using your <xliff:g id="types_list" example="camera( and location)">%s</xliff:g></string>

    <!-- Separator for permissions. Include spaces before and after if needed [CHAR LIMIT=10] -->
    <string name="ongoing_usage_dialog_separator">,\u0020</string>

    <!-- Separator for permissions, before last type. Include spaces before and after if needed [CHAR LIMIT=10] -->
    <string name="ongoing_usage_dialog_last_separator">\u0020and\u0020</string>

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

Loading