Code example for Map

Methods: get, put

0
  public Object getSystemService(String name) {
    if (name.equals(Context.LAYOUT_INFLATER_SERVICE)) {
      return new RoboLayoutInflater(realContextImpl);
    } 
 
    Object service = systemServices.get(name);
    if (service == null) {
      String serviceClassName = SYSTEM_SERVICE_MAP.get(name);
      if (serviceClassName == null) {
        System.err.println("WARNING: unknown service " + name);
        return null; 
      } 
 
      if (serviceClassName.equals("android.app.SearchManager")) {
        service = constructor().withParameterTypes(Context.class, Handler.class).in(SearchManager.class)
            .newInstance(realContextImpl, null);
      } else if (serviceClassName.equals("android.os.storage.StorageManager")) {
        service = constructor().withParameterTypes(Looper.class).in(StorageManager.class)
            .newInstance((Object) null);
      } else { 
        try { 
          service = newInstanceOf(Class.forName(serviceClassName));
        } catch (ClassNotFoundException e) {
          throw new RuntimeException(e);
        } 
      } 
      systemServices.put(name, service);
    } 
    return service;
  } 
 
  public void setSystemService(String key, Object service) {