Merge "First pass at APIs for contributing new media."
diff --git a/res/values-af/strings.xml b/res/values-af/strings.xml
index 7c965c2..a4475fe 100644
--- a/res/values-af/strings.xml
+++ b/res/values-af/strings.xml
@@ -36,10 +36,8 @@
<string name="sound_name_sway" msgid="348448316663085643">"Slinger"</string>
<string name="sound_name_wag" msgid="2730733083078126563">"Swaai"</string>
<string name="add_ringtone_text" msgid="8077717303037760418">"Voeg luitoon by"</string>
- <!-- no translation found for add_alarm_text (2440919366091720815) -->
- <skip />
- <!-- no translation found for add_notification_text (5013822215567515665) -->
- <skip />
+ <string name="add_alarm_text" msgid="2440919366091720815">"Voeg wekker by"</string>
+ <string name="add_notification_text" msgid="5013822215567515665">"Voeg kennisgewing by"</string>
<string name="delete_ringtone_text" msgid="2963662097583300181">"Vee uit"</string>
<string name="unable_to_add_ringtone" msgid="6256097521165711269">"Kan nie gepasmaakte luitoon byvoeg nie"</string>
<string name="unable_to_delete_ringtone" msgid="2258180073859253495">"Kan nie gepasmaakte luitoon uitvee nie"</string>
diff --git a/res/values-am/strings.xml b/res/values-am/strings.xml
index 9a4d410..93c6108 100644
--- a/res/values-am/strings.xml
+++ b/res/values-am/strings.xml
@@ -36,10 +36,8 @@
<string name="sound_name_sway" msgid="348448316663085643">"ተወዛወዝ"</string>
<string name="sound_name_wag" msgid="2730733083078126563">"አወዛውዝ"</string>
<string name="add_ringtone_text" msgid="8077717303037760418">"የጥሪ ቅላጼ አክል"</string>
- <!-- no translation found for add_alarm_text (2440919366091720815) -->
- <skip />
- <!-- no translation found for add_notification_text (5013822215567515665) -->
- <skip />
+ <string name="add_alarm_text" msgid="2440919366091720815">"የማንቂያ ደውል አክል"</string>
+ <string name="add_notification_text" msgid="5013822215567515665">"ማሳወቂያን አክል"</string>
<string name="delete_ringtone_text" msgid="2963662097583300181">"ሰርዝ"</string>
<string name="unable_to_add_ringtone" msgid="6256097521165711269">"ብጁ የጥሪ ቅላጼን ማከል አልተቻለም"</string>
<string name="unable_to_delete_ringtone" msgid="2258180073859253495">"ብጁ የጥሪ ቅላጼን መሰረዝ አልተቻለም"</string>
diff --git a/res/values-bs/strings.xml b/res/values-bs/strings.xml
index ed9466f..2444147 100644
--- a/res/values-bs/strings.xml
+++ b/res/values-bs/strings.xml
@@ -36,8 +36,8 @@
<string name="sound_name_sway" msgid="348448316663085643">"Njihanje"</string>
<string name="sound_name_wag" msgid="2730733083078126563">"Klaćenje"</string>
<string name="add_ringtone_text" msgid="8077717303037760418">"Dodaj melodiju zvona"</string>
- <string name="add_alarm_text" msgid="2440919366091720815">"Dodaj alarm"</string>
- <string name="add_notification_text" msgid="5013822215567515665">"Dodaj obavijest"</string>
+ <string name="add_alarm_text" msgid="2440919366091720815">"Dodajte alarm"</string>
+ <string name="add_notification_text" msgid="5013822215567515665">"Dodajte obavještenje"</string>
<string name="delete_ringtone_text" msgid="2963662097583300181">"Izbriši"</string>
<string name="unable_to_add_ringtone" msgid="6256097521165711269">"Nije moguće dodati prilagođenu melodiju zvona"</string>
<string name="unable_to_delete_ringtone" msgid="2258180073859253495">"Nije moguće izbrisati prilagođenu melodiju zvona"</string>
diff --git a/src/com/android/providers/media/MediaDocumentsProvider.java b/src/com/android/providers/media/MediaDocumentsProvider.java
index c5af9db..18a9461 100644
--- a/src/com/android/providers/media/MediaDocumentsProvider.java
+++ b/src/com/android/providers/media/MediaDocumentsProvider.java
@@ -625,12 +625,31 @@
}
@Override
- public Cursor queryRecentDocuments(String rootId, String[] projection)
+ public Cursor queryRecentDocuments(
+ String rootId, String[] projection, @Nullable Bundle queryArgs,
+ @Nullable CancellationSignal signal)
throws FileNotFoundException {
final ContentResolver resolver = getContext().getContentResolver();
final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
final long token = Binder.clearCallingIdentity();
+
+ int limit = -1;
+ if (queryArgs != null) {
+ limit = queryArgs.getInt(ContentResolver.QUERY_ARG_LIMIT, -1);
+ }
+ if (limit < 0) {
+ // Use default value, and no QUERY_ARG* is honored.
+ limit = 64;
+ } else {
+ // We are honoring the QUERY_ARG_LIMIT.
+ Bundle extras = new Bundle();
+ result.setExtras(extras);
+ extras.putStringArray(ContentResolver.EXTRA_HONORED_ARGS, new String[]{
+ ContentResolver.QUERY_ARG_LIMIT
+ });
+ }
+
Cursor cursor = null;
try {
if (TYPE_IMAGES_ROOT.equals(rootId)) {
@@ -638,7 +657,7 @@
cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI,
ImageQuery.PROJECTION, null, null, ImageColumns.DATE_MODIFIED + " DESC");
copyNotificationUri(result, cursor);
- while (cursor.moveToNext() && result.getCount() < 64) {
+ while (cursor.moveToNext() && result.getCount() < limit) {
includeImage(result, cursor);
}
} else if (TYPE_VIDEOS_ROOT.equals(rootId)) {
@@ -646,7 +665,7 @@
cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
VideoQuery.PROJECTION, null, null, VideoColumns.DATE_MODIFIED + " DESC");
copyNotificationUri(result, cursor);
- while (cursor.moveToNext() && result.getCount() < 64) {
+ while (cursor.moveToNext() && result.getCount() < limit) {
includeVideo(result, cursor);
}
} else {
diff --git a/src/com/android/providers/media/MediaProvider.java b/src/com/android/providers/media/MediaProvider.java
index fa20f17..797e916 100644
--- a/src/com/android/providers/media/MediaProvider.java
+++ b/src/com/android/providers/media/MediaProvider.java
@@ -831,6 +831,7 @@
db.execSQL("DELETE from artists");
db.execSQL("ALTER TABLE files ADD COLUMN title_resource_uri TEXT DEFAULT NULL");
db.execSQL("UPDATE files SET date_modified=0");
+ updateAddColorSpaces(db);
}
private static void updateFromOCSchema(SQLiteDatabase db) {
@@ -839,6 +840,7 @@
db.execSQL("ALTER TABLE files ADD COLUMN title_resource_uri TEXT DEFAULT NULL");
db.execSQL("UPDATE files SET date_modified=0"
+ " WHERE (is_alarm IS 1) OR (is_ringtone IS 1) OR (is_notification IS 1)");
+ updateAddColorSpaces(db);
}
private static void updateAddOwnerPackageName(SQLiteDatabase db, boolean internal) {
@@ -867,7 +869,7 @@
}
}
- private static void updateAddColorSpaces(SQLiteDatabase db, boolean internal) {
+ private static void updateAddColorSpaces(SQLiteDatabase db) {
// Add the color aspects related column used for HDR detection etc.
db.execSQL("ALTER TABLE files ADD COLUMN color_standard INTEGER;");
db.execSQL("ALTER TABLE files ADD COLUMN color_transfer INTEGER;");
@@ -912,7 +914,7 @@
updateAddOwnerPackageName(db, internal);
}
if (fromVersion < 1003) {
- updateAddColorSpaces(db, internal);
+ updateAddColorSpaces(db);
}
if (fromVersion < 1004) {
updateAddHashAndPending(db, internal);