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

Commit 7d45e023 authored by Christopher Tate's avatar Christopher Tate Committed by android-build-merger
Browse files

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

am: cd0aa9cd

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

Change-Id: I3b28a8c03cee7fe6f85540f1f679de10de09923c
parents b5952d22 cd0aa9cd
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);