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

Commit 42833b2f authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Checkpoint of new storage UI.

Top-level storage UI now shows list of all devices, both internal
and adopted/private volumes, and public/shared volumes.

When viewing a private volume, show traditional clustering of data
types, including summary of other users.  For adopted volumes, any
actions are tucked away in a menu, since they're not primary.  Misc
files browsing is now provided by DocumentsUI.

Teach StorageMeasurement about new private volumes, including
handling emulated volumes stacked above them.  When measuring, only
consider apps actually hosted on the current volume UUID.

When viewing a public volume, we default to launching into file
management mode, and offer a simple eject button at the top-level
view.  File management mode is offered by new DocumentsUI browse
intent, and a Settings link there redirects back to us for actual
operations like ejecting/formatting.  When unmounted, we launch
into our action view.

Actions like ejecting/formatting just show simple toasts for now.

Bug: 19993667
Change-Id: Ie990ef3c01fb3717aaf8c79bfc53aac7edefdcf7
parent 09c0c138
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -1415,15 +1415,31 @@
                <category android:name="android.intent.category.VOICE_LAUNCH" />
            </intent-filter>
            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                android:value="com.android.settings.deviceinfo.Memory" />
                android:value="com.android.settings.deviceinfo.StorageSettings" />
            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
                android:resource="@id/storage_settings" />
            <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
                android:value="true" />
        </activity>

        <activity android:name=".deviceinfo.MiscFilesHandler"
                android:theme="@style/Theme.SubSettingsDialogWhenLarge"/>
        <activity
                android:name="Settings$StorageVolumeSettingsActivity"
                android:label="@string/storage_settings_title"
                android:taskAffinity="com.android.settings"
                android:parentActivityName="Settings$StorageSettingsActivity">
            <intent-filter>
                <action android:name="android.provider.action.DOCUMENT_ROOT_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
                <data
                    android:scheme="content"
                    android:host="com.android.externalstorage.documents"
                    android:mimeType="vnd.android.document/root" />
            </intent-filter>
            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                android:value="com.android.settings.deviceinfo.PublicVolumeSettings" />
            <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
                android:resource="@id/storage_settings" />
        </activity>

        <activity android:name="ApnEditor"
                android:label="@string/apn_edit">
+47 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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="match_parent"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/unmount"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:paddingStart="16dip"
        android:paddingEnd="16dip"
        android:contentDescription="@string/storage_menu_unmount"
        android:layout_gravity="center"
        android:gravity="center"
        android:textSize="30sp"
        android:background="?android:attr/selectableItemBackground" />

    <!--
    <ImageView
        android:id="@+id/eject"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:paddingStart="16dip"
        android:paddingEnd="16dip"
        android:src="@drawable/ic_sync_green_holo"
        android:contentDescription="@string/storage_menu_eject"
        android:layout_gravity="center"
        android:background="?android:attr/selectableItemBackground" />
    -->
</LinearLayout>
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 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.
-->

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/storage_rename"
        android:title="@string/storage_menu_rename" />
    <item
        android:id="@+id/storage_mount"
        android:title="@string/storage_menu_mount" />
    <item
        android:id="@+id/storage_unmount"
        android:title="@string/storage_menu_unmount" />
    <item
        android:id="@+id/storage_format"
        android:title="@string/storage_menu_format" />
    <item
        android:id="@+id/storage_usb"
        android:title="@string/storage_menu_usb" />
</menu>
+41 −2
Original line number Diff line number Diff line
@@ -593,6 +593,9 @@
    <!-- Button label for generic forget action [CHAR LIMIT=20] -->
    <string name="forget">Forget</string>

    <!-- Button label for generic save action [CHAR LIMIT=20] -->
    <string name="save">Save</string>

    <!-- Title of the Settings activity shown within the application itself. -->
    <string name="settings_label">Settings</string>
    <!-- Title of the Settings activity shown in the Launcher. [CHAR LIMIT=20] -->
@@ -2185,7 +2188,7 @@
    <!-- SD card & phone storage settings summary. Displayed when the total memory usage is being calculated. Will be replaced with a number like "12.3 GB" when finished calucating. [CHAR LIMIT=30] -->
    <string name="memory_calculating_size">Calculating\u2026</string>
    <!-- SD card & phone storage settings title. Displayed as a title when showing the total usage of applications installed. Below it will be a number like "123.4 MB" indicating used storage. [CHAR LIMIT=50] -->
    <string name="memory_apps_usage">Apps (app data &amp; media content)</string>
    <string name="memory_apps_usage">Apps &amp; app data</string>
    <!-- SD card & phone storage settings title. Displayed as a title when showing the total usage of media on the device. Below it will be a number like "123.4 MB" indicating used storage. [CHAR LIMIT=50] -->
    <string name="memory_media_usage">Media</string>
    <!-- SD card & phone storage settings title. Displayed as a title when showing the total usage of /sdcard/Download on the device. Below it will be a number like "123.4 MB" indicating used storage. [CHAR LIMIT=50] -->
@@ -2195,7 +2198,7 @@
    <!-- SD card & phone storage settings title. Displayed as a title when showing the total usage of audio files in /sdcard on the device. Below it will be a number like "123.4 MB" indicating used storage. [CHAR LIMIT=50] -->
    <string name="memory_music_usage">Audio (music, ringtones, podcasts, etc.)</string>
    <!-- SD card & phone storage settings title. Displayed as a title when showing the total usage of misc files on the device. Below it will be a number like "123.4 MB" indicating used storage. [CHAR LIMIT=50] -->
    <string name="memory_media_misc_usage">Misc.</string>
    <string name="memory_media_misc_usage">Other files</string>
    <!-- Storage item representing all cached data on device. [CHAR LIMIT=48] -->
    <string name="memory_media_cache_usage">Cached data</string>
    <!-- SD card & phone storage settings item title that will result in the phone unmounting the SD card.  This will be done before the user phyiscally removes the SD card from the phone.  Kind of like the "Safely remove" on some operating systems.   [CHAR LIMIT=25] -->
@@ -2270,6 +2273,16 @@
    <!-- Settings item summary when storage is running low [CHAR LIMIT=NONE] -->
    <string name="storage_low_summary">Some system functions, such as syncing, may not work correctly. Try to free space by deleting or unpinning items, such as apps or media content.</string>

    <!-- Storage setting.  Menu option for renaming a storage device [CHAR LIMIT=30]-->
    <string name="storage_menu_rename">Rename</string>
    <!-- Storage setting.  Menu option for mounting a storage device [CHAR LIMIT=30]-->
    <string name="storage_menu_mount">Mount</string>
    <!-- Storage setting.  Menu option for unmounting a storage device [CHAR LIMIT=30]-->
    <string name="storage_menu_unmount">Eject</string>
    <!-- Storage setting.  Menu option for erasing and formatting a storage device [CHAR LIMIT=30]-->
    <string name="storage_menu_format">Erase &amp; format</string>
    <!-- Storage setting.  Menu option for erasing and formatting a storage device [CHAR LIMIT=30]-->
    <string name="storage_menu_format_internal">Erase &amp; format as internal storage</string>
    <!-- Storage setting.  Menu option for USB transfer settings [CHAR LIMIT=30]-->
    <string name="storage_menu_usb">USB computer connection</string>

@@ -2293,6 +2306,32 @@
    <!-- Section header above list of other users storage [CHAR LIMIT=32] -->
    <string name="storage_other_users">Other users</string>

    <!-- Section header above list of internal storage devices [CHAR LIMIT=30]-->
    <string name="storage_internal_title">Device storage</string>
    <!-- Section header above list of external storage devices [CHAR LIMIT=30]-->
    <string name="storage_external_title">Removable storage</string>

    <!-- Summary of a single storage volume, constrasting available and total storage space. [CHAR LIMIT=48]-->
    <string name="storage_volume_summary"><xliff:g id="free" example="1.2GB">%1$s</xliff:g> free (Total <xliff:g id="total" example="32GB">%2$s</xliff:g>)</string>

    <!-- Toast informing that storage mount operation was successful. [CHAR LIMIT=64]-->
    <string name="storage_mount_success"><xliff:g id="name" example="SD card">%1$s</xliff:g> is mounted</string>
    <!-- Toast informing that storage unmount operation failed. [CHAR LIMIT=64]-->
    <string name="storage_mount_failure">Couldn\'t mount <xliff:g id="name" example="SD card">%1$s</xliff:g></string>

    <!-- Toast informing that storage unmount operation was successful. [CHAR LIMIT=64]-->
    <string name="storage_unmount_success"><xliff:g id="name" example="SD card">%1$s</xliff:g> is safely ejected</string>
    <!-- Toast informing that storage unmount operation failed. [CHAR LIMIT=64]-->
    <string name="storage_unmount_failure">Couldn\'t safely eject <xliff:g id="name" example="SD card">%1$s</xliff:g></string>

    <!-- Toast informing that storage format operation was successful. [CHAR LIMIT=64]-->
    <string name="storage_format_success"><xliff:g id="name" example="SD card">%1$s</xliff:g> is formatted</string>
    <!-- Toast informing that storage format operation failed. [CHAR LIMIT=64]-->
    <string name="storage_format_failure">Couldn\'t format <xliff:g id="name" example="SD card">%1$s</xliff:g></string>

    <!-- Title of dialog prompting user to rename a storage volume [CHAR LIMIT=32]-->
    <string name="storage_rename_title">Rename storage</string>

    <!-- Phone info screen, section titles: -->
    <string name="battery_status_title">Battery status</string>
    <!-- Phone info screen, section titles: -->
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@
        <dashboard-tile
                android:id="@+id/storage_settings"
                android:title="@string/storage_settings"
                android:fragment="com.android.settings.deviceinfo.Memory"
                android:fragment="com.android.settings.deviceinfo.StorageSettings"
                android:icon="@drawable/ic_settings_storage"
                />

Loading