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

Commit 67835caf authored by alukin's avatar alukin
Browse files

Split Documents&Other

Splitting Documents&Other category in
Settings > Storage into "Documents"
and "Other".

"Documents" category is calculated by
querying MediaStore for all files with
MediaType = "Document".

"Other" category is calculated by
querying MediaStore for all files with
MEDIA_TYPE != "Image" AND MEDIA_TYPE != "Video"
AND MEDIA_TYPE != "Audio" AND MEDIA_TYPE != "Document".

Bug: 328505030
Test: atest StorageItemPreferenceControllerTest
Test: atest StorageCacheHelperTest
Change-Id: I413c502c7b3fd66df9a3b5e0d91f8bd024f4b6e0
parent 80d12dbc
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2024 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.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="960"
        android:viewportHeight="960"
        android:tint="?android:attr/colorControlNormal">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M260,440L480,80L700,440L260,440ZM700,880Q625,880 572.5,827.5Q520,775 520,700Q520,625 572.5,572.5Q625,520 700,520Q775,520 827.5,572.5Q880,625 880,700Q880,775 827.5,827.5Q775,880 700,880ZM120,860L120,540L440,540L440,860L120,860ZM700,800Q742,800 771,771Q800,742 800,700Q800,658 771,629Q742,600 700,600Q658,600 629,629Q600,658 600,700Q600,742 629,771Q658,800 700,800ZM200,780L360,780L360,620L200,620L200,780ZM402,360L558,360L480,234L402,360ZM480,360L480,360L480,360L480,360ZM360,620L360,620L360,620L360,620L360,620ZM700,700Q700,700 700,700Q700,700 700,700Q700,700 700,700Q700,700 700,700Q700,700 700,700Q700,700 700,700Q700,700 700,700Q700,700 700,700Z"/>
</vector>
 No newline at end of file
+5 −2
Original line number Diff line number Diff line
@@ -604,8 +604,11 @@
    <!-- Media Uri to view audio storage category. -->
    <string name="config_audio_storage_category_uri" translatable="false">content://com.android.providers.media.documents/root/audio_root</string>

    <!-- Media Uri to view documents & other storage category. -->
    <string name="config_documents_and_other_storage_category_uri" translatable="false">content://com.android.providers.media.documents/root/documents_root</string>
    <!-- Media Uri to view documents storage category. -->
    <string name="config_documents_storage_category_uri" translatable="false">content://com.android.providers.media.documents/root/documents_root</string>

    <!-- Media Uri to view "other" storage category. -->
    <string name="config_other_storage_category_uri" translatable="false">content://com.android.providers.media.documents/root/others_root</string>

    <!-- Whether to show Smart Storage toggle -->
    <bool name="config_show_smart_storage_toggle">true</bool>
+0 −3
Original line number Diff line number Diff line
@@ -10968,9 +10968,6 @@
    <!-- Preference label for the Apps storage section. [CHAR LIMIT=50] -->
    <string name="storage_apps">Apps</string>
    <!-- Preference label for the Documents & other storage section. [CHAR LIMIT=50] -->
    <string name="storage_documents_and_other">Documents &amp; other</string>
    <!-- Old Preference label for the System storage section. [CHAR LIMIT=50] -->
    <string name="storage_system">System</string>
+8 −3
Original line number Diff line number Diff line
@@ -57,15 +57,20 @@
        android:icon="@drawable/ic_videogame_vd_theme_24"
        android:order="105"/>
    <com.android.settings.deviceinfo.StorageItemPreference
        android:key="pref_documents_and_other"
        android:title="@string/storage_documents_and_other"
        android:key="pref_documents"
        android:title="@string/storage_documents"
        android:icon="@drawable/ic_folder_vd_theme_24"
        android:order="106"/>
    <com.android.settings.deviceinfo.StorageItemPreference
        android:key="pref_other"
        android:title="@string/storage_other"
        android:icon="@drawable/ic_category_vd_theme_24"
        android:order="107"/>
    <com.android.settings.deviceinfo.StorageItemPreference
        android:key="pref_trash"
        android:title="@string/storage_trash"
        android:icon="@drawable/ic_trash_can"
        android:order="107"/>
        android:order="108"/>
    <!-- Preference order 100~200 are 'ONLY' for storage category
    preferences that are sorted by size. -->
    <PreferenceCategory
+8 −3
Original line number Diff line number Diff line
@@ -76,15 +76,20 @@
        android:icon="@drawable/ic_videogame_vd_theme_24"
        android:order="105"/>
    <com.android.settings.deviceinfo.StorageItemPreference
        android:key="pref_documents_and_other"
        android:title="@string/storage_documents_and_other"
        android:key="pref_documents"
        android:title="@string/storage_documents"
        android:icon="@drawable/ic_folder_vd_theme_24"
        android:order="106"/>
    <com.android.settings.deviceinfo.StorageItemPreference
        android:key="pref_other"
        android:title="@string/storage_other"
        android:icon="@drawable/ic_category_vd_theme_24"
        android:order="107"/>
    <com.android.settings.deviceinfo.StorageItemPreference
        android:key="pref_trash"
        android:title="@string/storage_trash"
        android:icon="@drawable/ic_trash_can"
        android:order="107"/>
        android:order="108"/>
    <!-- Preference order 100~200 are 'ONLY' for storage category
    preferences that are sorted by size. -->
    <PreferenceCategory
Loading