Adding missing Build Version check and @TargetApi annotation.

Intent.EXTRA_ALLOW_MULTIPLE is only available in JellyBean MR2 and
higher. So added missing check for same. To avoid warning at build
added @TargetApi annotation.

BUG=401333

Review URL: https://codereview.chromium.org/453963002

Cr-Commit-Position: refs/heads/master@{#288358}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288358 0039d316-1c4b-4281-b951-d872f2087c98
parent 94a6ce55
...@@ -56,6 +56,7 @@ class SelectFileDialog implements WindowAndroid.IntentCallback{ ...@@ -56,6 +56,7 @@ class SelectFileDialog implements WindowAndroid.IntentCallback{
* @param multiple Whether it should be possible to select multiple files. * @param multiple Whether it should be possible to select multiple files.
* @param window The WindowAndroid that can show intents * @param window The WindowAndroid that can show intents
*/ */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
@CalledByNative @CalledByNative
private void selectFile( private void selectFile(
String[] fileTypes, boolean capture, boolean multiple, WindowAndroid window) { String[] fileTypes, boolean capture, boolean multiple, WindowAndroid window) {
...@@ -84,7 +85,7 @@ class SelectFileDialog implements WindowAndroid.IntentCallback{ ...@@ -84,7 +85,7 @@ class SelectFileDialog implements WindowAndroid.IntentCallback{
Intent getContentIntent = new Intent(Intent.ACTION_GET_CONTENT); Intent getContentIntent = new Intent(Intent.ACTION_GET_CONTENT);
getContentIntent.addCategory(Intent.CATEGORY_OPENABLE); getContentIntent.addCategory(Intent.CATEGORY_OPENABLE);
if (multiple) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && multiple)
getContentIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); getContentIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
ArrayList<Intent> extraIntents = new ArrayList<Intent>(); ArrayList<Intent> extraIntents = new ArrayList<Intent>();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment