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

Commit f0e5e9c7 authored by Chris Tate's avatar Chris Tate Committed by android-build-merger
Browse files

Merge "Don\'t bother with WeakHashMap for direct alarm bookkeeping" into nyc-dev am: cd0aa9cd

am: 7d45e023

* commit '7d45e023':
  Don't bother with WeakHashMap for direct alarm bookkeeping

Change-Id: I55cda3493282a252f301398be1d6218ec6edbeff
parents d7b4635d 7d45e023
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -28,12 +28,12 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.os.WorkSource;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.Log;

import libcore.util.ZoneInfoDB;

import java.io.IOException;
import java.util.WeakHashMap;

/**
 * This class provides access to the system alarm services.  These allow you
@@ -244,7 +244,7 @@ public class AlarmManager {

    // Tracking of the OnAlarmListener -> wrapper mapping, for cancel() support.
    // Access is synchronized on the AlarmManager class object.
    private static WeakHashMap<OnAlarmListener, ListenerWrapper> sWrappers;
    private static ArrayMap<OnAlarmListener, ListenerWrapper> sWrappers;

    /**
     * package private on purpose
@@ -631,7 +631,7 @@ public class AlarmManager {
        if (listener != null) {
            synchronized (AlarmManager.class) {
                if (sWrappers == null) {
                    sWrappers = new WeakHashMap<OnAlarmListener, ListenerWrapper>();
                    sWrappers = new ArrayMap<OnAlarmListener, ListenerWrapper>();
                }

                recipientWrapper = sWrappers.get(listener);