summaryrefslogtreecommitdiffstats
path: root/res/xml
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-09-14 08:36:33 -0700
committerYorke Lee <yorkelee@google.com>2013-09-18 17:08:47 -0700
commit637a38ec9de6b1f434d7a13105f2e747faae5107 (patch)
treefd21257d119abf64c1237d9110abc7ee9eeb294d /res/xml
parent671f8dd51bf4ecf67847c0654e7d8253b4fda09a (diff)
downloadpackages_apps_Contacts-637a38ec9de6b1f434d7a13105f2e747faae5107.tar.gz
packages_apps_Contacts-637a38ec9de6b1f434d7a13105f2e747faae5107.tar.bz2
packages_apps_Contacts-637a38ec9de6b1f434d7a13105f2e747faae5107.zip
Make contacts photo pickers compatible with new documents UI
The old contacts photo picker code was using unguaranteed behavior (that Intent.GET_CONTENT would support MediaStore.EXTRA_OUTPUT) and this caused it to not work anymore with the new document picker. This CL changes all usages of files to instead use URIs. Also, a FileProvider has been added to Contacts, to allow us to pass in URI pointing to our private cache in intent.setClipData with Intent.FLAG_GRANT_WRITE_URI_PERMISSION and Intent.FLAG_GRANT_READ_URI_PERMISSION so we no longer have to reply on the MediaStore.EXTRA_OUTPUT being parsed and supported. The use of the FileProvider also prevents unauthorized access to temporary files during the caching process. Bug: 10745342 Change-Id: Iaee3d7d112dd124a2f5596c4b9704ea75d3b3419
Diffstat (limited to 'res/xml')
-rw-r--r--res/xml/file_paths.xml20
1 files changed, 20 insertions, 0 deletions
diff --git a/res/xml/file_paths.xml b/res/xml/file_paths.xml
new file mode 100644
index 000000000..294c0cbfc
--- /dev/null
+++ b/res/xml/file_paths.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 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.
+-->
+
+<paths xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Offer access to files under Context.getCacheDir() -->
+ <cache-path name="my_cache" />
+</paths>