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

Commit 3a51f31f authored by Sindhu B's avatar Sindhu B
Browse files

Fix: Remove the updateListeners from QSIconViewImpl.java which was causing...

Fix: Remove the updateListeners from QSIconViewImpl.java which was causing memory leak in the SystemUI process.

Bug: 327078684
Flag: com.android.systemui.removeUpdateListenerInQsIconViewImpl
Test: Manually tested by dumping the java heap and view that heap profile in perfetto ui.

Change-Id: Ie5a0d36724303d74f614f0f6991616ab3b9bbf69
parent 6a5eb0f8
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -1188,6 +1188,16 @@ flag {
  bug: "352600066"
}

flag {
   namespace: "systemui"
   name: "remove_update_listener_in_qs_icon_view_impl"
   description: "Remove update listeners in QsIconViewImpl class to avoid memory leak."
   bug: "327078684"
   metadata {
       purpose: PURPOSE_BUGFIX
   }
}

flag {
   name: "sim_pin_race_condition_on_restart"
   namespace: "systemui"
+5 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@

package com.android.systemui.qs.tileimpl;

import static com.android.systemui.Flags.removeUpdateListenerInQsIconViewImpl;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ArgbEvaluator;
@@ -204,6 +206,9 @@ public class QSIconViewImpl extends QSIconView {
            values.setEvaluator(ArgbEvaluator.getInstance());
            mColorAnimator.setValues(values);
            mColorAnimator.removeAllListeners();
            if (removeUpdateListenerInQsIconViewImpl()) {
                mColorAnimator.removeAllUpdateListeners();
            }
            mColorAnimator.addUpdateListener(animation -> {
                setTint(iv, (int) animation.getAnimatedValue());
            });