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

Commit ced7a45a authored by Amin Shaikh's avatar Amin Shaikh
Browse files

Deprecate scoped directory access.

- Change ScopedAccessActivity to immediately return RESULT_CANCELLED
- Delete all unused code/resources associated with this activity
- Delete ScopedAccessProvider
- Log all launches of android.os.storage.action.OPEN_EXTERNAL_DIRECTORY
intents in Q+ to a "docsui_scoped_directory_access_deprecated" counter

Bug: 111892460
Test: atest \
      cts/tests/providerui/src/android/providerui/cts/MediaStoreUiTest.java \
      cts/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java \
      cts/hostsidetests/appsecurity/test-apps/DocumentClient/src/com/android/cts/documentclient/ScopedDirectoryAccessClientTest.java

Change-Id: I9096f3490ba303bcdc557e0e86ce142593dfe9b1
parent 8d8d92f3
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -37,8 +37,6 @@ android_app {
        "minimal/src/com/android/documentsui/picker/DummyPickActivity.java",
        "src/com/android/documentsui/ScopedAccessActivity.java",
        "src/com/android/documentsui/ScopedAccessMetrics.java",
        "src/com/android/documentsui/ScopedAccessPackageReceiver.java",
        "src/com/android/documentsui/ScopedAccessProvider.java",
        "src/com/android/documentsui/archives/Archive.java",
        "src/com/android/documentsui/archives/ArchiveId.java",
        "src/com/android/documentsui/archives/ArchivesProvider.java",
+0 −7
Original line number Diff line number Diff line
@@ -137,13 +137,6 @@
            </intent-filter>
        </activity>

        <provider
            android:name=".ScopedAccessProvider"
            android:authorities="com.android.documentsui.scopedAccess"
            android:permission="android.permission.MANAGE_SCOPED_ACCESS_DIRECTORY_PERMISSIONS"
            android:exported="true">
        </provider>

        <provider
            android:name=".picker.LastAccessedProvider"
            android:authorities="com.android.documentsui.lastAccessed"
+0 −15
Original line number Diff line number Diff line
@@ -54,20 +54,5 @@
            </intent-filter>
        </activity>

        <receiver android:name=".ScopedAccessPackageReceiver">
            <intent-filter>
                <action android:name="android.intent.action.PACKAGE_FULLY_REMOVED" />
                <action android:name="android.intent.action.PACKAGE_DATA_CLEARED" />
                <data android:scheme="package" />
            </intent-filter>
        </receiver>

        <provider
            android:name=".ScopedAccessProvider"
            android:authorities="com.android.documentsui.scopedAccess"
            android:permission="android.permission.MANAGE_SCOPED_ACCESS_DIRECTORY_PERMISSIONS"
            android:exported="true">
        </provider>

    </application>
</manifest>
+0 −44
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:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:theme="@style/Theme.AppCompat.Light.Dialog.Alert"
    android:orientation="vertical"
    android:paddingEnd="24dp"
    android:paddingStart="24dp" >

    <TextView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/message"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingEnd="24dp"
        android:paddingStart="32dp"
        android:paddingTop="24dp">
    </TextView>

    <CheckBox
        android:id="@+id/do_not_ask_checkbox"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dip"
        android:text="@string/never_ask_again"
        android:textColor="?android:attr/textColorSecondary"
        android:visibility="gone" />
</LinearLayout>
+0 −2
Original line number Diff line number Diff line
@@ -34,8 +34,6 @@
    <!-- Text in an alert dialog asking user to grant app access to all data in an external storage volume -->
    <string name="open_external_dialog_root_request">Grant <xliff:g id="appName" example="System Settings"><b>^1</b></xliff:g>
        access to your data, including photos and videos, on <xliff:g id="storage" example="SD Card"><i>^2</i></xliff:g>?</string>
    <!-- Checkbox that allows user to not be questioned about the directory access request again -->
    <string name="never_ask_again">Don\'t ask again</string>
    <!-- Text in the button asking user to allow access to a given directory. -->
    <string name="allow">Allow</string>
    <!-- Text in the button asking user to deny access to a given directory. -->
Loading