History log of /packages/apps/Contacts/src/com/android/contacts/util/ContactPhotoUtils.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
637a38ec9de6b1f434d7a13105f2e747faae5107 14-Sep-2013 Yorke Lee <yorkelee@google.com> 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
/packages/apps/Contacts/src/com/android/contacts/util/ContactPhotoUtils.java
9bcfc325333797ad968fbb42583a2006effdef4a 05-Oct-2012 Johan Redestig <johan.redestig@sonymobile.com> Make locale safe paths

generateTempPhotoFileName was using SimpleDateFormat
with the default locale to create paths. In some locales
this resulted in characters that are not safe to use
on all file systems. Explicitly use Locale.US to
be locale safe.

Change-Id: I23fdc90042fcf2c323ef58e25fd34220e21648ca
/packages/apps/Contacts/src/com/android/contacts/util/ContactPhotoUtils.java
61414c2c4627ab588cc0f54eae5e0c5591f7d8d9 19-Jun-2012 Chiao Cheng <chiaocheng@google.com> Fixed bug where contact photo did not scale up when cropped.

- Added scaleUpIfNeeded extra to gallery intents.
- Consolidated gallery "extras" code into common utility method.

Bug: 6678247
Change-Id: I4c2b9fb2a88d203fe06303b470f0eb35a5cc6766
/packages/apps/Contacts/src/com/android/contacts/util/ContactPhotoUtils.java
ebc17929007ecf12f25b8e90023766e8a083d11e 05-May-2012 Josh Gargus <jjosh@google.com> Don't stash cropped photos in /sdcard/DCIM.

Every time we choose a new contact photo (either an existing one from
the gallery or a new one from the camera), we write the cropped image
/sdcard/DCIM. As a result, the cropped image (eventually) appears in
the gallery, is uploaded to G+, etc.

The new behavior is to write the cropped photo to a temp directory,
and to clear it when we're done with it.

Revert some of the changes from Ib7037a66; we still need to persist
properties in onSaveInstanceState() in case ContactEditorFragment is
killed while the user interacts with the camera/gallery.

Bug: 6423139
Change-Id: Icf8cb5b4824e3d8757ff483ef128527ac9132e72
/packages/apps/Contacts/src/com/android/contacts/util/ContactPhotoUtils.java
e5d3f897689c8ba0f275c7679c72eacb190ae9b8 11-Apr-2012 Josh Gargus <jjosh@google.com> Fix regression; once again we can apply Gallery photo to contact.

The changes to support hi-res photos in Ic0cabaa5 were not applied to
AttachPhotoActivity. This CL makes the analogous changes, and many other
cleanups besides.

In addition, applying the Gallery photo works even if the AttachPhotoActivity
is killed (eg: when selecting a contact, or when cropping the photo); this
didn't work even before the regression.

The save-contact Intent which invokes the ContactSaveService no longer
needs to specify a callback Activity (it is OK to pass null if you don't
care about getting a callback).

The subclasses of PhotoSelectionHandler have been significantly simplified,
partly by pushing common behavior to the superclass, and also by directly
accessing state in their outer class instead making their own copies.

ContactLoader.Result.getEntityDeltaList() is a new instance method that
replaces more verbose incantations.

New utility class, ContactPhotoUtils. Helps with compressing Bitmaps, and
generating temp-file names used when saving hi-res photos to a contact.

Bug: 6298601
Change-Id: I2fe90c33c9fa81716f263d82ed80c0d6f63c6a7e
/packages/apps/Contacts/src/com/android/contacts/util/ContactPhotoUtils.java