diff options
author | calderwoodra <calderwoodra@google.com> | 2018-02-24 11:37:28 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-02-24 11:38:19 -0800 |
commit | 35ecd12f1617f36d8d22fecdabf9c63cbf92599d (patch) | |
tree | 716006ff47663e8741ab609b4cfc153df8348183 /java/com/android/dialer/app/list/PhoneFavoriteTileView.java | |
parent | a39e732c6326f6265a213024bbb6899aea04f10a (diff) |
Cancel Old SpeedDial contact loaders when they are reset.
This prevents to many loaders running at the same time and crashing the
application for using too many threads at once.
Also made a few UI changes:
- Change Android nav bar color to #FFF
- Move badges down 2dp
- Limit badges to 9+ (instead of 99+, added flag to configure this)
- search bar no longer has rounded corners when expanded
Bug: 72525324
Test: MainActivityOldPeerTest
PiperOrigin-RevId: 186894920
Change-Id: I36fc5d8794440b707184d54de427db5910ec5b8e
Diffstat (limited to 'java/com/android/dialer/app/list/PhoneFavoriteTileView.java')
-rw-r--r-- | java/com/android/dialer/app/list/PhoneFavoriteTileView.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java index 3b27d3118..3739588ea 100644 --- a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java +++ b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java @@ -32,7 +32,6 @@ import com.android.dialer.app.R; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallSpecificAppData; import com.android.dialer.callintent.SpeedDialContactType; -import com.android.dialer.common.LogUtil; import com.android.dialer.contactphoto.ContactPhotoManager.DefaultImageRequest; import com.android.dialer.lettertile.LetterTileDrawable; import com.android.dialer.logging.InteractionEvent; @@ -192,21 +191,17 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { this.position = position; } + private ContactLoader loader; + /** * Send a notification using a {@link ContactLoader} to inform the sync adapter that we are * viewing a particular contact, so that it can download the high-res photo. */ - private static void sendViewNotification(Context context, Uri contactUri) { - ContactLoader loader = new ContactLoader(context, contactUri, true /* postViewNotification */); - loader.registerListener( - 0, - (loader1, contact) -> { - try { - loader1.reset(); - } catch (RuntimeException e) { - LogUtil.e("PhoneFavoriteTileView.onLoadComplete", "error resetting loader", e); - } - }); + private void sendViewNotification(Context context, Uri contactUri) { + if (loader != null) { + loader.cancelLoad(); + } + loader = new ContactLoader(context, contactUri, true /* postViewNotification */); loader.startLoading(); } } |