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

Commit ba8be52f authored by Roy Chou's avatar Roy Chou Committed by Automerger Merge Worker
Browse files

chore(non linear font scaling): remove mAlwaysScaleIcon in StatusBarIconView...

chore(non linear font scaling): remove mAlwaysScaleIcon in StatusBarIconView am: c7f002fd am: 4424d981

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23662313



Change-Id: I4c7980b4bba8c32c48c426e7719689bb79fba320
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9b302377 4424d981
Loading
Loading
Loading
Loading
+8 −16
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import android.os.Trace;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.FloatProperty;
import android.util.Log;
import android.util.Property;
@@ -131,7 +130,6 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
        }
    };

    private boolean mAlwaysScaleIcon;
    private int mStatusBarIconDrawingSizeIncreased = 1;
    private int mStatusBarIconDrawingSize = 1;
    private int mStatusBarIconSize = 1;
@@ -207,21 +205,11 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
        maybeUpdateIconScaleDimens();
    }

    public StatusBarIconView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mDozer = new NotificationIconDozeHelper(context);
        mBlocked = false;
        mAlwaysScaleIcon = true;
        reloadDimens();
        maybeUpdateIconScaleDimens();
        mDensity = context.getResources().getDisplayMetrics().densityDpi;
    }

    /** Should always be preceded by {@link #reloadDimens()} */
    private void maybeUpdateIconScaleDimens() {
        // We do not resize and scale system icons (on the right), only notification icons (on the
        // left).
        if (mNotification != null || mAlwaysScaleIcon) {
        if (isNotification()) {
            updateIconScaleForNotifications();
        } else {
            updateIconScaleForSystemIcons();
@@ -309,6 +297,10 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
        maybeUpdateIconScaleDimens();
    }

    private boolean isNotification() {
        return mNotification != null;
    }

    private static boolean streq(String a, String b) {
        if (a == b) {
            return true;
@@ -416,7 +408,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi

    Drawable getIcon(StatusBarIcon icon) {
        Context notifContext = getContext();
        if (mNotification != null) {
        if (isNotification()) {
            notifContext = mNotification.getPackageContext(getContext());
        }
        return getIcon(getContext(), notifContext != null ? notifContext : getContext(), icon);
@@ -471,7 +463,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
    @Override
    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
        super.onInitializeAccessibilityEvent(event);
        if (mNotification != null) {
        if (isNotification()) {
            event.setParcelableData(mNotification.getNotification());
        }
    }
@@ -624,7 +616,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
    }

    private void initializeDecorColor() {
        if (mNotification != null) {
        if (isNotification()) {
            setDecorColor(getContext().getColor(mNightMode
                    ? com.android.internal.R.color.notification_default_color_dark
                    : com.android.internal.R.color.notification_default_color_light));