// Signature format: 2.0
package com.android.server {

  public final class LocalManagerRegistry {
    method public static <T> void addManager(@NonNull Class<T>, @NonNull T);
    method @Nullable public static <T> T getManager(@NonNull Class<T>);
  }

  public abstract class SystemService {
    ctor public SystemService(@NonNull android.content.Context);
    method @NonNull public final android.content.Context getContext();
    method public boolean isUserSupported(@NonNull com.android.server.SystemService.TargetUser);
    method public void onBootPhase(int);
    method public abstract void onStart();
    method public void onUserStarting(@NonNull com.android.server.SystemService.TargetUser);
    method public void onUserStopped(@NonNull com.android.server.SystemService.TargetUser);
    method public void onUserStopping(@NonNull com.android.server.SystemService.TargetUser);
    method public void onUserSwitching(@Nullable com.android.server.SystemService.TargetUser, @NonNull com.android.server.SystemService.TargetUser);
    method public void onUserUnlocked(@NonNull com.android.server.SystemService.TargetUser);
    method public void onUserUnlocking(@NonNull com.android.server.SystemService.TargetUser);
    method protected final void publishBinderService(@NonNull String, @NonNull android.os.IBinder);
    method protected final void publishBinderService(@NonNull String, @NonNull android.os.IBinder, boolean);
    field public static final int PHASE_ACTIVITY_MANAGER_READY = 550; // 0x226
    field public static final int PHASE_BOOT_COMPLETED = 1000; // 0x3e8
    field public static final int PHASE_DEVICE_SPECIFIC_SERVICES_READY = 520; // 0x208
    field public static final int PHASE_LOCK_SETTINGS_READY = 480; // 0x1e0
    field public static final int PHASE_SYSTEM_SERVICES_READY = 500; // 0x1f4
    field public static final int PHASE_THIRD_PARTY_APPS_CAN_START = 600; // 0x258
    field public static final int PHASE_WAIT_FOR_DEFAULT_DISPLAY = 100; // 0x64
  }

  public static final class SystemService.TargetUser {
    method @NonNull public android.os.UserHandle getUserHandle();
  }

}

package com.android.server.role {

  public interface RoleServicePlatformHelper {
    method @NonNull public String computePackageStateHash(int);
    method @NonNull public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getLegacyRoleState(int);
  }

}

package com.android.server.wifi {

  public class SupplicantManager {
    method public static void start();
    method public static void stop();
  }

}

