History log of /packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
57a0e98eed836b72dd3dc3540b9cac029266ed7c 25-Mar-2017 Wenyi Wang <wenyiw@google.com> Add isLoggable checks to all verbose and debug log outputs (1/2)

Bug: 6813854

Test: built apk and verified log is seen in logcat

Change-Id: Ib17cac0d2d9553276c4271221110305ab2d70a46
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
0256e997434b81d11f5b51b97c49bac75acd6d63 16-Dec-2016 Gary Mai <garymai@google.com> Fix crash from using third party gallery apps
am: 84b1654c1d

Change-Id: Id9cbb149aa86332ab60a4f8d06a51d62be169b19
84b1654c1dd798e018b988cf1d6be28e0b21f4bd 16-Dec-2016 Gary Mai <garymai@google.com> Fix crash from using third party gallery apps

Some third party apps return unexpected URI's when photos are
cropped. An example is the Piktures app.
Instead of trusting their URI returned in the intent, copy the
photo from theirs into one which was generated by us and use that.

Test: Verified saving a contact with a picture that was cropped
from the Piktures app doesn't crash.

Bug: 33617676
Change-Id: I33e8922e5d89fabfcb90009d32b82a8a3f26c262
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
0a49afa2ad697307cc04ef4cb86570574fa720f2 06-Dec-2016 Gary Mai <garymai@google.com> Collapse common package (2/2)

Ran optimize imports on the project as well to re-order everything
which would have changed because of removing common.

Test: Built GoogleContacts, GoogleContactsTests, Contacts,
ContactsTests and ran unit tests.

Bug: 33252370
Change-Id: I881f0ba8b8fef002b6eeefa9a16b34f15b2fd2a9
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
69c182afb0e6d82a341a28b4317aa703af768906 05-Dec-2016 Gary Mai <garymai@google.com> Collapse common packages (1/?)

Move the majority of packages out of common. When trying to move
common.activity to activities every file switched from a rename to
separated deletes and adds. Will move tests and the rest of common
in a separate CL.

Test: Built GoogleContacts, Contacts, GoogleContactsTests,
ContactsTests.

Bug: 33252370
Change-Id: I9ffb20038dee255ef5f83002b7870265771b08c5
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
bfea74f34f3c1c4ea33302c0c59635acb7b801ad 19-Oct-2015 Wenyi Wang <wenyiw@google.com> Further UI tweak of photo picker

- When photo picker is shown, the action bar title will be "Choose photo".
- Modified column width of GridView in photo picker to use entire screen
width.
- Changed the folder of all photos button to "all photos"

Bug: 24988706

Change-Id: Ia3e3ddf515c308e1cf6cdabc4c99fd7f9d983bc0
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
5234be9645f202e94e9e0872efaa6ce9486dbf55 14-May-2015 Brian Attwell <brianattwell@google.com> Allow setting photos in managed profile

Bug: 20628786
Change-Id: I42bc27574d40b7725e64743961c250a5682f66f7
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
a9433713594c990cd3b0ac5a44e316e4b54992b0 28-Feb-2015 Jay Shrauner <shrauner@google.com> Fix NPE when copying photo URI

Bug:19564741
Change-Id: I0a4e0ccf2a917d403d1411fc737da293c81aded0
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
7e67082d3f7c4ab56945040c0e4617b71c7e5f0b 08-Nov-2014 Brian Attwell <brianattwell@google.com> New design for photo editor

The photo editor field now looks like the mocks. It includes
a RadioButton that allows users to choose which photo is
primary. This RadioButton only appears if more than one raw
contact has a photo inside the contact.

Additional changes:
-fixed non-regression that made it impossible to
set some photos as primary
-fixed non-regression that made it possible for multiple
photos to appear as primary
-I fudged with a bunch of padding values in order to
compensate for View insets and paddings. This can't always
be done perfectly, since some insets/paddings vary based
on screen-configuration. I needed to start taking fudging
with these paddings in order to make the photo editor look
consistent with the other editor fields.

This CL doesn't bother ensuring the readonly photo edit
field looks good. This will be done in a later CL.

Bug: 18004959
Change-Id: I683f3ffa8e7f8683c2c083a2b4592b2b95c58c63
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
b126f4a7427095468ee66fa4c3b9586f0b889288 18-Jan-2014 Jay Shrauner <shrauner@google.com> Fix crash in getPhotoPickSize

Handle null or empty cursors.

Bug:12619944
Change-Id: I5cae8c16e29474afbc78a172f39bbb04daec446a
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
cd321f65f1e50409812976380ad1f0fdb3fa35cb 28-Oct-2013 Yorke Lee <yorkelee@google.com> Move ContactLoader related code to ContactsCommon

This CL simply moves classes from Contacts into ContactsCommon.

This is needed so that Dialer can use ContactLoader related code
for b/11294679. A ContactLoader will also be needed in the future
to allow InCallUI to download hi-res photos while in call.
Bug: 11294679

Change-Id: Ia033f3ea2406a907a4e71290c9ce810a5583dab8
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
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/detail/PhotoSelectionHandler.java
619ac169e45bf547a2cbcd8a9775bb234f45c00f 20-Dec-2012 Chiao Cheng <chiaocheng@google.com> Use single method to handle all popup.dismiss() logic.

Refactor to reduce duplicate code.

Bug: 7902358
Change-Id: I6395635eba435ef6ebe4a34125d9a310c18f7e93
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
738ff8623dc77dd91a1b9023861e924ba5e4c27e 30-Nov-2012 Chiao Cheng <chiaocheng@google.com> Move ValuesDelta to ContactsCommon.

Bug: 6993891
Change-Id: I8b065c55100a152f72cccea5b62f10a8e30161c2
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
aa690d4949b8105e5bcf10569b7cf4fae36741de 29-Nov-2012 Chiao Cheng <chiaocheng@google.com> Prefactor RawContactDelta.ValuesDelta into top level class.

Making ValuesDelta into top level class so we do not have to move
RawContactDelta into ContactsCommon. ValuesDelta is used by
CustomContactListFilterActivity which needs to be moved.

Bug: 6993891
Change-Id: If7371cf08ac0e14218fb790c96856e971fa613ec
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
0d5588da244d0992c3ff8f25d0875fdf95a8c644 27-Nov-2012 Chiao Cheng <chiaocheng@google.com> Move AccountTypeManager to ContactsCommon.

Moving AccountTypeManager to ContactsCommon so it can be shared by Contacts
and Dialer.

Bug: 6993891
Change-Id: I9526ac7cda758290caecabfcaebe620238d8dd6b
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
428f008513d1591cc08fcfe2cf0c9237fb313241 14-Nov-2012 Chiao Cheng <chiaocheng@google.com> Move dependencies of AccountTypeManager into ContactsCommon.

Moving dependencies in preparation to move AccountTypeManager.

Bug: 6993891
Change-Id: I804cdbe64b9b8111ed286037943d593e11dc4044
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
851222a96b5d68602fb361ea3527101e893f67e3 21-Jun-2012 Maurice Chu <mochu@google.com> Added thin object layer around contact data

This refactoring abstracts out the need to directly
refer to Contacts database columns throughout the code. Instead,
all of this information is retained in getter/setter methods
within the Contact, RawContact, and DataItem classes and
sub-classes.

ContactLoader.Result class has been pulled to the top level as
the Contact class.

The Entity class has been removed and replaced with a RawContact
class, with getters/setters to raw contact information.
Renamed EntityDelta to RawContactDelta for better understandability
as well as adding getters/setters for specific fields in the
ValuesDelta nested class within EntityDelta. EntityDeltaList
and EntityModifier have been renamed to RawContactDeltaList and
RawContactModifier with the methods using the RawContact class
directly rather than the Entity class.

Data items for a raw contact are represented by a DataItem object
with specialized getters/setters for subclasses of DataItem.
(e.g., EmailDataItem, PhoneDataItem. etc.). DataItem is a wrapper
around ContentValues. This abstracts away the ContactsContract
column fields into getters/setters.

The above refactoring is accompanied with changes throughout the
codebase to use the new Contact, RawContact, and DataItem classes.

Change-Id: I31c1dccd724e9652f9d0af78ca81feb6c5acd71d
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.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/detail/PhotoSelectionHandler.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/detail/PhotoSelectionHandler.java
9a409d474b2b4f2e4261657f864eeb866fcb8816 24-Apr-2012 Daniel Lehmann <lehmannd@google.com> Fix an NPE in PhotoSelectionHandler. mListener was always null

- Also fixed an independent crash when replacing a photo from Details
- Also renamed mListener in ContactEditorFragment to avoid name shadowing

Bug:6387900

Change-Id: I000009c6c8d4ea4a07168f99530e4ef1f648a333
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.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/detail/PhotoSelectionHandler.java
e692e010ca02200087997280e7c239ebf94aa8f9 18-Jan-2012 Josh Gargus <jjosh@google.com> Support for high-resolution contact photos.

Rather than getting a bitmap directly from the gallery app, with
this change we create a temporary file and request that the photo
be stored there. This avoids running into bundle size limits when
passing large, uncompressed bitmaps back from the gallery.

After reading the photo out into the Contacts app, we use the
openAssetFile API to stream the large photo data into the
Contacts Provider. Note that we do this rather than having Gallery
write directly to the provider because we have no guarantee that
the Gallery (or substitute) app has WRITE_CONTACTS permission.

In the Contact Editor, the image is not permanently stored until
the contact is saved. This avoids needing special logic to handle
the case where the contact is newly-created.

Fix bug 5907233 en passant... the vestiges of some partially-
expunged code were causing the ContentEditorFragment to not
apply a selected photo.

Bug: 5786849
Bug: 5907233
Change-Id: Ic0cabaa50c08d6a9a0b730698c92f4092192438a
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java
6fa7384a1a5576ace18159de61af91c8b7c34dc6 28-Sep-2011 Dave Santoro <dsantoro@google.com> Allow adding/replacing a photo from contact card.

This involves a large refactoring of the photo handling code that
previously lived in ContactEditorFragment. The bulk of that logic
has been extracted out into PhotoSelectionHandler and
PhotoSelectionActivity classes.

As part of this change, also removed the selection highlighting when
tapping on the current tab header in multi-tab views.

Bug 5294297
Bug 5379389

Change-Id: Ic929e4b4a730d91f768a34367bb76967228ded17
/packages/apps/Contacts/src/com/android/contacts/detail/PhotoSelectionHandler.java