summaryrefslogtreecommitdiffstats
path: root/packages/ExternalStorageProvider
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-10-11 12:55:26 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-11 12:55:26 -0700
commitc69cf322520f4fe48b67d52bf76d22674dcfee8a (patch)
treef21bf124d484ea7ac0784da933a27b621e1c50ea /packages/ExternalStorageProvider
parentd2bb1dd0310920ba703944016814a28688cbafda (diff)
parent416165f4313ac2deea430030ff44d9da0388b8bc (diff)
downloadframeworks_base-c69cf322520f4fe48b67d52bf76d22674dcfee8a.zip
frameworks_base-c69cf322520f4fe48b67d52bf76d22674dcfee8a.tar.gz
frameworks_base-c69cf322520f4fe48b67d52bf76d22674dcfee8a.tar.bz2
am 416165f4: am ce05cbc5: am 6e19feb4: Merge "Treat dates near epoch as unknown." into klp-dev
* commit '416165f4313ac2deea430030ff44d9da0388b8bc': Treat dates near epoch as unknown.
Diffstat (limited to 'packages/ExternalStorageProvider')
-rw-r--r--packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java
index 9328b33..189e985 100644
--- a/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java
+++ b/packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java
@@ -73,7 +73,11 @@ public class ExternalStorageProvider extends DocumentsProvider {
mIdToRoot = Maps.newHashMap();
mIdToPath = Maps.newHashMap();
- // TODO: support multiple storage devices
+ // TODO: support multiple storage devices, requiring that volume serial
+ // number be burned into rootId so we can identify files from different
+ // volumes. currently we only use a static rootId for emulated storage,
+ // since that storage never changes.
+ if (!Environment.isExternalStorageEmulated()) return true;
try {
final String rootId = "primary";
@@ -182,8 +186,13 @@ public class ExternalStorageProvider extends DocumentsProvider {
row.add(Document.COLUMN_DISPLAY_NAME, displayName);
row.add(Document.COLUMN_SIZE, file.length());
row.add(Document.COLUMN_MIME_TYPE, mimeType);
- row.add(Document.COLUMN_LAST_MODIFIED, file.lastModified());
row.add(Document.COLUMN_FLAGS, flags);
+
+ // Only publish dates reasonably after epoch
+ long lastModified = file.lastModified();
+ if (lastModified > 31536000000L) {
+ row.add(Document.COLUMN_LAST_MODIFIED, lastModified);
+ }
}
@Override