History log of /packages/apps/Phone/src/com/android/phone/BitmapUtils.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a1a9601840e50e18ff8ca4be9b888e592287577b 11-Sep-2012 Dianne Hackborn <hackbod@google.com> Don't crash phone app when running as non-primary user.

Rename PhoneApp to PhoneGlobals. Add new PhoneApp that only
instantiates PhoneGlobals when running as the primary user. Add
check in PhoneGlobals.getInstance() to immediately throw if called
when there are no globals for that process. Add new
PhoneGlobals.getInstanceIfPrimary() that doesn't throw;
OtaStartupReceiver uses to abort early if receiving a BOOT_COMPLETED
for a non-primary user.

All of the other files here are just due to the rename of PhoneApp
to PhoneGlobals.

Change-Id: Ic3999d956198ac836cb6a07fa3c77f36c1754ea3
/packages/apps/Phone/src/com/android/phone/BitmapUtils.java
b424ca2073702aff4ac1d9297d8bbe73ee4cd8b9 25-Aug-2011 David Brown <dab@google.com> In-call UI: New visual design treatment for lo-res contact photos

Add a special effect for "lo-res" contact photos (i.e. the 96x96
thumbnails we typically get from contacts sync.)

Rather than simply scaling up the image (which looks terrible since the
onscreen photo is now so much larger than the source image) we instead
show a large blurred version of the image, overlaid with a smaller "inset"
of the original unblurred image.

Implementation details:

- InCallContactPhoto: this new class behaves just like an ImageView,
*except* if you call setImageDrawable() and pass in a BitmapDrawable
that's 96x96 or smaller. In that case, the "special effect" kicks in:
We generate a blurred version of the input bitmap, display that in the
InCallContactPhoto widget itself, and also show a separate ImageView
with a smaller "inset" of the original image.

The CallCard now uses InCallContactPhotos instead of ImageViews for both
the foregound and "on hold" contact photos. (We never show the inset
for the "on hold" call, though.)

- BitmapUtils: this is a new utility class that contains the actual
gaussianBlur() implementation (borrowed from the Music2 app.)

- Performance seems fine so far; the blur adds something like 100msec to
the setImageDrawable() call, but that happens asynchronously anyway
(since we already have to wait for the contact photo lookup) so it has
no effect on the initial startup time of the InCallScreen.

(But if this *does* turn out to be a problem there's definitely room for
improvement, like by optimizing the current BitmapUtils code, or even by
pushing the gaussianBlur() implementation down into RenderScript.)

TESTED:
- Lo-res photos from contacts sync:
==> blur + inset effect is shown
- Hi-res photos from the device's camera:
==> original photo is shown with no special effect
- Incoming and outgoing calls
- Two calls in use / swap / merge
- Turn the screen on and off during a call
- Exit and return to the in-call screen during a call

Bug: 5037325

Change-Id: Ia1e6aefceac3d0cac63aa975d5bf72d9f68c2c94
/packages/apps/Phone/src/com/android/phone/BitmapUtils.java