diff options
author | Android Partner Docs <noreply@android.com> | 2017-08-22 10:41:24 -0700 |
---|---|---|
committer | Clay Murphy <claym@google.com> | 2017-08-22 15:01:44 -0700 |
commit | f16c42333aa6b2de30a344dd68246d4a33d93e7d (patch) | |
tree | 311af599312cacb21c888aeae828cae59b0d64a1 /en/devices/storage | |
parent | 04426e67ca3ee557a0083f9b3c6ba789021bd7a0 (diff) | |
download | source.android.com-f16c42333aa6b2de30a344dd68246d4a33d93e7d.tar.gz |
Docs: Changes to source.android.com
- 166080694 Devsite localized content from translation request a3d5a7... by Android Partner Docs <noreply@android.com>
- 166079245 Remove duplicate TOC entry to oob-users.html. by mheco <mheco@google.com>
- 166002955 Update builds for Oreo by Android Partner Docs <noreply@android.com>
- 165977566 Fixing bad conversion by hvm <hvm@google.com>
- 165977199 Edit links to point to public source files in AOSP. by cqn <cqn@google.com>
- 165962883 Add codename to CTS downloads page. by gdimino <gdimino@google.com>
- 165955117 Integration of O branch into mainline. by gdimino <gdimino@google.com>
- 165638251 Update July public Android security bulletin to remove QC... by Android Partner Docs <noreply@android.com>
- 165638198 Update June public Android security bulletin to remove QC... by Android Partner Docs <noreply@android.com>
- 165638174 Update May public Android security bulletin to remove QC ... by Android Partner Docs <noreply@android.com>
- 165638096 Update April public Android security bulletin to remove Q... by Android Partner Docs <noreply@android.com>
- 165528993 Update to Keymaster 2 and remove requirements language by daroberts <daroberts@google.com>
- 165511119 Add Bluetooth verification / debug information by cqn <cqn@google.com>
- 165491345 Fixed link broken by file rename. by cqn <cqn@google.com>
- 165381648 Fixed broken image paths and renamed HCI Requirements file. by cqn <cqn@google.com>
- 165365185 Created high-level Bluetooth directory and added HTML ver... by cqn <cqn@google.com>
- 165335694 Devsite localized content from translation request 66a39c... by Android Partner Docs <noreply@android.com>
- 165246927 Update August 2017 bulletin with CVE-2017-0687 by daroberts <daroberts@google.com>
PiperOrigin-RevId: 166080694
Change-Id: I2d3a8d77fa6a66c2099f13ba2e864545328fd17a
Diffstat (limited to 'en/devices/storage')
-rw-r--r-- | en/devices/storage/config.html | 16 | ||||
-rw-r--r-- | en/devices/storage/faster-stats.html | 106 |
2 files changed, 116 insertions, 6 deletions
diff --git a/en/devices/storage/config.html b/en/devices/storage/config.html index f9f31c79..58a031a3 100644 --- a/en/devices/storage/config.html +++ b/en/devices/storage/config.html @@ -24,9 +24,13 @@ <p>External storage is managed by a combination of the <code>vold</code> init -service and <code>StorageManagerService</code> system service. Mounting of physical -external storage volumes is handled by <code>vold</code>, which performs -staging operations to prepare the media before exposing it to apps.</p> +service and <code>StorageManagerService</code> system service. Mounting of +physical external storage volumes is handled by <code>vold</code>, which +performs staging operations to prepare the media before exposing it to apps.</p> + +<p class="note"><strong>Note:</strong> In Android 8.0, the +<code>MountService</code> class was renamed to +<code>StorageManagerService</code>.</p> <h2 id=file_mappings>File mappings</h2> <p>For Android 4.2.2 and earlier, the device-specific <code>vold.fstab</code> @@ -69,9 +73,9 @@ Other possible flags are <code>nonremovable</code>, <h2 id=configuration_details>Configuration details</h2> <p>External storage interactions at and above the framework level are handled -through <code>MountService</code>. Due to configuration changes in Android 6.0 (like the -removal of the storage_list.xml resource overlay), the configuration details -are split into two categories.</p> +through <code>StorageManagerService</code>. Due to configuration changes in +Android 6.0 (like the removal of the storage_list.xml resource overlay), the +configuration details are split into two categories.</p> <h3 id=android_5_x_and_earlier>Android 5.x and earlier</h3> diff --git a/en/devices/storage/faster-stats.html b/en/devices/storage/faster-stats.html new file mode 100644 index 00000000..0e43a9e1 --- /dev/null +++ b/en/devices/storage/faster-stats.html @@ -0,0 +1,106 @@ +<html devsite> + <head> + <title>Faster Storage Statistics</title> + <meta name="project_path" value="/_project.yaml" /> + <meta name="book_path" value="/_book.yaml" /> + </head> + <body> + <!-- + Copyright 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. + --> + +<p> +In earlier versions of Android, the system traversed all files owned by a +particular app to measure disk usage. This manual measurement could take minutes +to compute before displaying the results to users in Settings. +</p> +<p> +In addition, the internal algorithm to clear cached data files only looked at +modified time across all apps. This allowed malicious apps to degrade the +overall user experience by setting modified times far in the future to unfairly +favor themselves over other apps. +</p> +<p> +To improve these experiences, Android 8.0 offers to leverage the ext4 filesystem's +"quota" support to return disk usage statistics almost instantly. This quota +feature also improves system stability by preventing any single app from using +more than 90% of disk space or 50% of inodes. +</p> +<h2 id="implementation">Implementation</h2> +<p> +The quota feature is part of the default implementation of <code>installd</code>. +<code>installd</code> automatically uses the quota feature when enabled on a +particular filesystem. The system automatically and transparently resumes +manual calculation when the quota feature isn't enabled or supported on the +block device being measured. +</p> +<p> +To enable quota support on a particular block device: +</p> +<ol> +<li>Enable the <code>CONFIG_QUOTA</code>, <code>CONFIG_QFMT_V2</code>, and +<code>CONFIG_QUOTACTL</code> kernel options.</li> +<li>Add the <code>quota</code> option to your userdata partition in your fstab +file: +<pre> +/dev/block/platform/soc/624000.ufshc/by-name/userdata /data +ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc +latemount,wait,check,formattable,fileencryption=ice<strong>,quota</strong></pre> +</li> +</ol> +<p> +The <code>fstab</code> option can safely be enabled or disabled on existing +devices. During the first boot after changing the <code>fstab</code> option, +<code>fsmgr</code> forces an <code>fsck</code> pass to update all quota data +structures, which may cause that first boot to take slightly longer. Subsequent +boots will not be affected. +</p> +<p> +Quota support has only been tested on ext4 and Linux 3.18 or higher. If enabling +on other filesystems, or on older kernel versions, device manufacturers are +responsible for testing and vetting for statistics correctness. +</p> +<p> +No special hardware support is required. +</p> +<h2 id="validation">Validation</h2> +<p> +There are CTS tests under <code>StorageHostTest</code>, which exercise public +APIs for measuring disk usage. These APIs are expected to return correct values +regardless of quota support being enabled or disabled. +</p> +<h3 id="debugging">Debugging</h3> +<p> +The test app carefully allocates disk space regions using unique prime numbers +for the size. When debugging these tests, use this to determine the cause of any +discrepancies. For example, if a test fails with a delta of 11MB, examine the +<code>Utils.useSpace()</code> method to see that the 11MB blob was stored in +<code>getExternalCacheDir()</code>. +</p> +<p> +There are also some internal tests that may be useful for debugging, but they +may require disabling security checks to pass: +</p> + + +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">runtest -x frameworks/base/services/tests/servicestests/ \ + src/com/android/server/pm/InstallerTest.java</code> +<code class="devsite-terminal">adb shell /data/nativetest64/installd_utils_test/installd_utils_test</code> +<code class="devsite-terminal">adb shell /data/nativetest64/installd_cache_test/installd_cache_test</code> +<code class="devsite-terminal">adb shell /data/nativetest64/installd_service_test/installd_service_test</code> +</pre> +</body> +</html> |