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

Commit f0d921c4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Replace HashMap with ArrayMap for services"

parents 5578077a 360b2c44
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -150,6 +150,7 @@ import android.telephony.TelephonyManager;
import android.telephony.euicc.EuiccCardManager;
import android.telephony.euicc.EuiccManager;
import android.telephony.ims.RcsManager;
import android.util.ArrayMap;
import android.util.Log;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
@@ -171,7 +172,7 @@ import com.android.internal.net.INetworkWatchlistManager;
import com.android.internal.os.IDropBoxManagerService;
import com.android.internal.policy.PhoneLayoutInflater;

import java.util.HashMap;
import java.util.Map;

/**
 * Manages all of the system services that can be returned by {@link Context#getSystemService}.
@@ -182,10 +183,10 @@ final class SystemServiceRegistry {

    // Service registry information.
    // This information is never changed once static initialization has completed.
    private static final HashMap<Class<?>, String> SYSTEM_SERVICE_NAMES =
            new HashMap<Class<?>, String>();
    private static final HashMap<String, ServiceFetcher<?>> SYSTEM_SERVICE_FETCHERS =
            new HashMap<String, ServiceFetcher<?>>();
    private static final Map<Class<?>, String> SYSTEM_SERVICE_NAMES =
            new ArrayMap<Class<?>, String>();
    private static final Map<String, ServiceFetcher<?>> SYSTEM_SERVICE_FETCHERS =
            new ArrayMap<String, ServiceFetcher<?>>();
    private static int sServiceCacheSize;

    // Not instantiable.
+2 −2
Original line number Diff line number Diff line
@@ -17,13 +17,13 @@
package android.os;

import android.annotation.UnsupportedAppUsage;
import android.util.ArrayMap;
import android.util.Log;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.os.BinderInternal;
import com.android.internal.util.StatLogger;

import java.util.HashMap;
import java.util.Map;

/** @hide */
@@ -38,7 +38,7 @@ public final class ServiceManager {
     * Cache for the "well known" services, such as WM and AM.
     */
    @UnsupportedAppUsage
    private static HashMap<String, IBinder> sCache = new HashMap<String, IBinder>();
    private static Map<String, IBinder> sCache = new ArrayMap<String, IBinder>();

    /**
     * We do the "slow log" at most once every this interval.