Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 465f0ec6 authored by Tyler Gunn's avatar Tyler Gunn Committed by Automerger Merge Worker
Browse files

Adjust avatar used for call streaming notification. am: 8a0898a7

parents a5427817 8a0898a7
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="48dp"
    android:height="48dp"
    android:viewportWidth="48"
    android:viewportHeight="48">
  <path
      android:pathData="M21.094,0.92C22.839,-0.307 25.161,-0.307 26.906,0.92C28.031,1.71 29.428,2.009 30.777,1.746C32.868,1.339 34.989,2.287 36.086,4.12C36.794,5.302 37.95,6.145 39.288,6.456C41.363,6.938 42.917,8.671 43.177,10.794C43.345,12.163 44.059,13.406 45.156,14.236C46.856,15.524 47.574,17.742 46.952,19.788C46.551,21.107 46.7,22.534 47.365,23.741C48.397,25.612 48.154,27.931 46.758,29.546C45.857,30.587 45.416,31.951 45.535,33.326C45.72,35.457 44.559,37.476 42.629,38.381C41.384,38.965 40.429,40.03 39.981,41.335C39.287,43.357 37.408,44.727 35.279,44.766C33.906,44.79 32.601,45.374 31.664,46.382C30.211,47.946 27.939,48.431 25.979,47.596C24.714,47.057 23.286,47.057 22.021,47.596C20.061,48.431 17.789,47.946 16.336,46.382C15.399,45.374 14.094,44.79 12.721,44.766C10.592,44.727 8.713,43.357 8.019,41.335C7.571,40.03 6.616,38.965 5.371,38.381C3.441,37.476 2.28,35.457 2.465,33.326C2.584,31.951 2.143,30.587 1.242,29.546C-0.154,27.931 -0.397,25.612 0.635,23.741C1.3,22.534 1.449,21.107 1.048,19.788C0.427,17.742 1.144,15.524 2.844,14.236C3.941,13.406 4.655,12.163 4.823,10.794C5.083,8.671 6.637,6.938 8.712,6.456C10.05,6.145 11.206,5.302 11.914,4.12C13.011,2.287 15.132,1.339 17.223,1.746C18.572,2.009 19.969,1.71 21.094,0.92Z"
      android:fillColor="#000000"/>
  <path
      android:pathData="M24.001,15.467C21.644,15.467 19.734,17.376 19.734,19.733C19.734,22.091 21.644,24 24.001,24C26.358,24 28.268,22.091 28.268,19.733C28.268,17.376 26.358,15.467 24.001,15.467ZM26.134,19.734C26.134,18.56 25.174,17.601 24,17.601C22.827,17.601 21.867,18.56 21.867,19.734C21.867,20.907 22.827,21.867 24,21.867C25.174,21.867 26.134,20.907 26.134,19.734ZM30.402,29.333C30.188,28.576 26.882,27.2 24.002,27.2C21.122,27.2 17.815,28.576 17.602,29.344V30.4H30.402V29.333ZM15.469,29.333C15.469,26.496 21.154,25.066 24.002,25.066C26.85,25.066 32.535,26.496 32.535,29.333V32.533H15.469V29.333Z"
      android:fillColor="#ffffff"
      android:fillType="evenOdd"/>
</vector>
+4 −25
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public class CallStreamingNotification extends CallsManagerListenerBase implemen
    private final AppLabelProxy mAppLabelProxy;
    // An executor that can be used to fire off async tasks that do not block Telecom in any manner.
    private final Executor mAsyncTaskExecutor;
    // The call which is treaming.
    // The call which is streaming.
    private Call mStreamingCall;
    // Lock for notification post/remove -- these happen outside the Telecom sync lock.
    private final Object mNotificationLock = new Object();
@@ -125,20 +125,6 @@ public class CallStreamingNotification extends CallsManagerListenerBase implemen
        }
    }

    /**
     * Handles changes to the caller info for a call.  Used to ensure we can update the photo uri
     * if one was found.
     * @param call the call which the caller info changed on.
     */
    @Override
    public void onCallerInfoChanged(Call call) {
        if (call == mStreamingCall) {
            Log.i(this, "onCallerInfoChanged: call=%s, photoUri=%b", call.getId(),
                    call.getContactPhotoUri());
            enqueueStreamingNotification(call);
        }
    }

    /**
     * Change the streaming call we are tracking.
     * @param call the call.
@@ -163,19 +149,12 @@ public class CallStreamingNotification extends CallsManagerListenerBase implemen
        mAsyncTaskExecutor.execute(() -> {
            Icon contactPhotoIcon = null;
            try {
                if (contactPhotoBitmap != null) {
                    // Make the icon rounded... because there has to be hoops to jump through.
                    RoundedBitmapDrawable roundedDrawable = RoundedBitmapDrawableFactory.create(
                            mContext.getResources(), contactPhotoBitmap);
                    roundedDrawable.setCornerRadius(Math.max(contactPhotoBitmap.getWidth(),
                            contactPhotoBitmap.getHeight()) / 2.0f);
                    contactPhotoIcon = Icon.createWithBitmap(drawableToBitmap(roundedDrawable,
                            contactPhotoBitmap.getWidth(), contactPhotoBitmap.getHeight()));
                }
                contactPhotoIcon = Icon.createWithResource(mContext.getResources(),
                        R.drawable.person_circle);
            } catch (Exception e) {
                // All loads of things can do wrong when working with bitmaps and images, so to
                // ensure Telecom doesn't crash, lets try/catch to be sure.
                Log.e(this, e, "enqueueStreamingNotification: Couldn't build rounded icon");
                Log.e(this, e, "enqueueStreamingNotification: Couldn't build avatar icon");
            }
            showStreamingNotification(call.getId(),
                    call.getUserHandleFromTargetPhoneAccount(), call.getCallerDisplayName(),