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

Commit 5d48be98 authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "Storage stats on external SD card in Settings." into honeycomb-mr2

parents cfd524f0 104ea287
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@
    <color name="memory_avail">#333333</color>
    <color name="memory_apps_usage">#77831A</color>
    <color name="memory_downloads">#476093</color>
    <color name="memory_video">#793A7F</color>
    <color name="memory_audio">#8E562A</color>
    <color name="memory_dcim">#793A7F</color>
    <color name="memory_music">#8E562A</color>
    <color name="memory_misc">#7C3030</color>
    
    <color name="crypt_keeper_clock_background">#ff9a9a9a</color>
+18 −20
Original line number Diff line number Diff line
@@ -313,8 +313,8 @@
    <string name="proxy_clear_text">Clear</string>
    <!-- HTTP proxy settings. The port number label. -->
    <string name="proxy_port_label">Proxy port</string>
    <!-- HTTP proxy settings. The hint text field for port. [CHAR LIMIT=50]-->
    <string name="proxy_port_hint">8080</string>
    <!-- HTTP proxy settings. The hint text field for port. -->
    <string name="proxy_port_hint" translatable="false">8080</string>
    <!-- HTTP proxy settings. The exclusion list label. -->
    <string name="proxy_exclusionlist_label">Bypass proxy for</string>
    <!-- HTTP proxy settings. The hint text for proxy exclusion list. [CHAR LIMIT=50]-->
@@ -1100,8 +1100,8 @@
    <string name="wifi_speed">Link speed</string>
    <!-- Label for the IP address of the connection -->
    <string name="wifi_ip_address">IP address</string>
    <!-- Hint text for the IP address [CHAR LIMIT=25]-->
    <string name="wifi_ip_address_hint">192.168.1.128</string>
    <!-- Hint text for the IP address -->
    <string name="wifi_ip_address_hint" translatable="false">192.168.1.128</string>
    <!-- Label for the EAP method of the network -->
    <string name="wifi_eap_method">EAP method</string>
    <!-- Label for the phase2 -->
@@ -1181,20 +1181,20 @@
    <string name="wifi_ip_settings_invalid_network_prefix_length">Please type a network prefix length between 0 and 32.</string>
    <!-- Label for the DNS (first one) -->
    <string name="wifi_dns1">DNS 1</string>
    <!-- Hint text for DNS [CHAR LIMIT=25]-->
    <string name="wifi_dns1_hint">8.8.8.8</string>
    <!-- Hint text for DNS -->
    <string name="wifi_dns1_hint" translatable="false">8.8.8.8</string>
    <!-- Label for the DNS (second one)-->
    <string name="wifi_dns2">DNS 2</string>
    <!-- Hint text for DNS [CHAR LIMIT=25]-->
    <string name="wifi_dns2_hint">4.4.4.4</string>
    <!-- Hint text for DNS -->
    <string name="wifi_dns2_hint" translatable="false">4.4.4.4</string>
    <!-- Label for the gateway of the network -->
    <string name="wifi_gateway">Gateway</string>
    <!-- Hint text for the gateway [CHAR LIMIT=25]-->
    <string name="wifi_gateway_hint">192.168.1.1</string>
    <!-- Hint text for the gateway -->
    <string name="wifi_gateway_hint" translatable="false">192.168.1.1</string>
    <!-- Label for the network prefix of the network [CHAR LIMIT=25]-->
    <string name="wifi_network_prefix_length">Network prefix length</string>
    <!-- Hint text for network prefix length [CHAR LIMIT=25] -->
    <string name="wifi_network_prefix_length_hint">24</string>
    <!-- Hint text for network prefix length -->
    <string name="wifi_network_prefix_length_hint" translatable="false">24</string>

    <!-- Wifi AP settings-->
    <!-- Label for wifi tether checkbox. Toggles Access Point on/off -->
@@ -1618,10 +1618,10 @@
    <!-- SD card & phone storage settings item title that will result in the phone mounting the SD card. -->
    <string name="sd_mount" product="default">Mount SD card</string>

    <!-- Subtext for Mount USB storage in Storage settings. User should never see this. -->
    <string name="sd_mount_summary" product="nosdcard">Mount the USB storage</string>
    <!-- SD card & phone storage settings item title that will result in the phone mounting the SD card. -->
    <string name="sd_mount_summary" product="default">Mount the SD card</string>
    <!-- Subtext for Mount USB storage in Storage settings. User should never see this since we use automount. -->
    <string name="sd_mount_summary" product="nosdcard"></string>
    <!-- Subtext for Mount SD Card in Storage settings. User should never see this since we use automount. -->
    <string name="sd_mount_summary" product="default"></string>
    <!-- SD card & phone storage settings item title that will result in the phone formatting the USB storage.   [CHAR LIMIT=25] -->
    <string name="sd_format" product="nosdcard">Erase USB storage</string>
    <!-- SD card & phone storage settings item title that will result in the phone formatting the SD card.   [CHAR LIMIT=25] -->
@@ -1630,9 +1630,7 @@
    <string name="sd_format_summary" product="nosdcard">Erases all data on the internal USB storage, such as music and photos</string>
    <!-- SD card & phone storage settings item title that will result in the phone unmounting the SD card.   [CHAR LIMIT=80] -->
    <string name="sd_format_summary" product="default">Erases all data on the SD card, such as music and photos</string>
    <!-- SD card status when it is not available status -->
    <string name="sd_unavailable">Unavailable</string>
    <!-- SD card status when it is mounted as read only  -->
    <!-- SD card status when it is mounted as read only. Will be appended to size, starts with an unbreakable space -->
    <string name="read_only">\u0020(Read-only)</string>
    <!-- SD card eject confirmation dialog title   [CHAR LIMIT=25] -->
    <string name="dlg_confirm_unmount_title" product="nosdcard">Unmount USB storage</string>
+1 −49
Original line number Diff line number Diff line
@@ -17,54 +17,6 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
        android:title="@string/storage_settings_title">

    <PreferenceCategory android:key="memory_sd"
            android:title="@string/sd_memory">
        <Preference android:key="memory_sd_size" 
            style="?android:attr/preferenceInformationStyle" 
            android:title="@string/memory_size"
            android:summary="00"/>
        <Preference android:key="memory_sd_avail" 
            style="?android:attr/preferenceInformationStyle" 
            android:title="@string/memory_available"
            android:summary="00"/>
        <Preference android:key="memory_sd_mount_toggle"
            android:title="@string/sd_eject"
            android:summary="@string/sd_eject_summary"/>
        <Preference android:key="memory_sd_format"
            android:title="@string/sd_format"
            android:summary="@string/sd_format_summary"/>
    </PreferenceCategory>
<!-- Preference categories are dynamically created based on the list of available storage volumes -->

    <PreferenceCategory android:title="@string/internal_memory">
        <com.android.settings.deviceinfo.UsageBarPreference
            android:key="memory_internal_chart"/>

        <Preference android:key="memory_internal_size"
            android:title="@string/memory_size"
            android:summary="@string/memory_calculating_size"/>

        <Preference android:key="memory_internal_apps"
            android:title="@string/memory_apps_usage"
            android:summary="@string/memory_calculating_size"/>

        <Preference android:key="memory_internal_downloads"
            android:title="@string/memory_downloads_usage"
            android:summary="@string/memory_calculating_size"/>

        <Preference android:key="memory_internal_dcim"
            android:title="@string/memory_dcim_usage"
            android:summary="@string/memory_calculating_size"/>

        <Preference android:key="memory_internal_music"
            android:title="@string/memory_music_usage"
            android:summary="@string/memory_calculating_size"/>

        <Preference android:key="memory_internal_media_misc"
            android:title="@string/memory_media_misc_usage"
            android:summary="@string/memory_calculating_size"/>

        <Preference android:key="memory_internal_avail"
            android:title="@string/memory_available"
            android:summary="@string/memory_calculating_size"/>
     </PreferenceCategory>
</PreferenceScreen>
+0 −102
Original line number Diff line number Diff line
/*
 * Copyright (C) 2010 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.
 */
package com.android.settings.deviceinfo;

import android.os.Environment;

import java.util.ArrayList;
import java.util.List;

/**
 * Some of the constants used in this package
 */
class Constants {
    static final int MEDIA_INDEX = 0;
    static final int DOWNLOADS_INDEX = 1;
    static final int PIC_VIDEO_INDEX = 2;
    static final int MUSIC_INDEX = 3;
    static final int MEDIA_APPS_DATA_INDEX = 4;
    static final int MEDIA_MISC_INDEX = 5;
    static final int NUM_MEDIA_DIRS_TRACKED = MEDIA_MISC_INDEX + 1;

    static class MediaDirectory {
        final String[] mDirPaths;
        final String mKey;
        final String mPreferenceName;
        MediaDirectory(String pref, String debugInfo, String... paths) {
            mDirPaths = paths;
            mKey = debugInfo;
            mPreferenceName = pref;
        }
    }
    static final ArrayList<MediaDirectory> mMediaDirs = new ArrayList<MediaDirectory>();
    static final List<String> ExclusionTargetsForMiscFiles = new ArrayList<String>();
    static {
        mMediaDirs.add(MEDIA_INDEX,
                new MediaDirectory(null,
                        "/sdcard",
                        Environment.getExternalStorageDirectory().getAbsolutePath()));
        mMediaDirs.add(DOWNLOADS_INDEX,
                new MediaDirectory("memory_internal_downloads",
                        "/sdcard/download",
                        Environment.getExternalStoragePublicDirectory(
                                Environment.DIRECTORY_DOWNLOADS).getAbsolutePath()));
        mMediaDirs.add(PIC_VIDEO_INDEX,
                new MediaDirectory("memory_internal_dcim",
                        "/sdcard/pic_video",
                        Environment.getExternalStoragePublicDirectory(
                                Environment.DIRECTORY_DCIM).getAbsolutePath(),
                        Environment.getExternalStoragePublicDirectory(
                                Environment.DIRECTORY_MOVIES).getAbsolutePath(),
                        Environment.getExternalStoragePublicDirectory(
                                Environment.DIRECTORY_PICTURES).getAbsolutePath()));
        mMediaDirs.add(MUSIC_INDEX,
                new MediaDirectory("memory_internal_music",
                        "/sdcard/audio",
                        Environment.getExternalStoragePublicDirectory(
                                Environment.DIRECTORY_MUSIC).getAbsolutePath(),
                        Environment.getExternalStoragePublicDirectory(
                                Environment.DIRECTORY_ALARMS).getAbsolutePath(),
                        Environment.getExternalStoragePublicDirectory(
                                Environment.DIRECTORY_NOTIFICATIONS).getAbsolutePath(),
                        Environment.getExternalStoragePublicDirectory(
                                Environment.DIRECTORY_RINGTONES).getAbsolutePath(),
                        Environment.getExternalStoragePublicDirectory(
                                Environment.DIRECTORY_PODCASTS).getAbsolutePath()));
        mMediaDirs.add(MEDIA_APPS_DATA_INDEX,
                new MediaDirectory(null,
                        "/sdcard/Android",
                        Environment.getExternalStorageAndroidDataDir().getAbsolutePath()));
        mMediaDirs.add(MEDIA_MISC_INDEX,
                new MediaDirectory("memory_internal_media_misc",
                        "misc on /sdcard",
                        "not relevant"));
        // prepare a lit of strings representing dirpaths that should be skipped while looking
        // for 'other' files
        for (int j = 0; j < Constants.NUM_MEDIA_DIRS_TRACKED - 1; j++) {
            String[] dirs = Constants.mMediaDirs.get(j).mDirPaths;
            int len = dirs.length;
            if (len > 0) {
                for (int k = 0; k < len; k++) {
                    ExclusionTargetsForMiscFiles.add(dirs[k]);
                }
            }
            // also add /sdcard/Android
            ExclusionTargetsForMiscFiles.add(
                    Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android");
        }
    }
}
+88 −367

File changed.

Preview size limit exceeded, changes collapsed.

Loading