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

Commit df52471c authored by Chet Haase's avatar Chet Haase Committed by Android Git Automerger
Browse files

am 5747919f: Merge "Fix leak in TransitionInflater" into klp-dev

* commit '5747919f':
  Fix leak in TransitionInflater
parents 6952b6fa 5747919f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1255,7 +1255,8 @@ public abstract class Transition implements Cloneable {
            Animator anim = runningAnimators.keyAt(i);
            if (anim != null) {
                AnimationInfo oldInfo = runningAnimators.get(anim);
                if (oldInfo != null) {
                if (oldInfo != null && oldInfo.view != null &&
                        oldInfo.view.getContext() == sceneRoot.getContext()) {
                    boolean cancel = false;
                    TransitionValues oldValues = oldInfo.values;
                    View oldView = oldInfo.view;
+1 −17
Original line number Diff line number Diff line
@@ -20,9 +20,7 @@ import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.util.ArrayMap;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.util.Xml;
import android.view.InflateException;
import android.view.ViewGroup;
@@ -43,15 +41,7 @@ import java.util.ArrayList;
 */
public class TransitionInflater {

    // We only need one inflater for any given context. Also, this allows us to associate
    // ids with unique instances per-Context, used to avoid re-inflating
    // already-inflated resources into new/different instances
    private static final ArrayMap<Context, TransitionInflater> sInflaterMap =
            new ArrayMap<Context, TransitionInflater>();

    private Context mContext;
    // TODO: do we need id maps for transitions and transitionMgrs as well?
    SparseArray<Scene> mScenes = new SparseArray<Scene>();

    private TransitionInflater(Context context) {
        mContext = context;
@@ -61,13 +51,7 @@ public class TransitionInflater {
     * Obtains the TransitionInflater from the given context.
     */
    public static TransitionInflater from(Context context) {
        TransitionInflater inflater = sInflaterMap.get(context);
        if (inflater != null) {
            return inflater;
        }
        inflater = new TransitionInflater(context);
        sInflaterMap.put(context, inflater);
        return inflater;
        return new TransitionInflater(context);
    }

    /**