// Signature format: 2.0
package android {

  public static final class Manifest.permission {
    field public static final String ACCESS_AMBIENT_LIGHT_STATS = "android.permission.ACCESS_AMBIENT_LIGHT_STATS";
    field public static final String ACCESS_BROADCAST_RADIO = "android.permission.ACCESS_BROADCAST_RADIO";
    field public static final String ACCESS_CACHE_FILESYSTEM = "android.permission.ACCESS_CACHE_FILESYSTEM";
    field public static final String ACCESS_DRM_CERTIFICATES = "android.permission.ACCESS_DRM_CERTIFICATES";
    field @Deprecated public static final String ACCESS_FM_RADIO = "android.permission.ACCESS_FM_RADIO";
    field public static final String ACCESS_MOCK_LOCATION = "android.permission.ACCESS_MOCK_LOCATION";
    field public static final String ACCESS_MTP = "android.permission.ACCESS_MTP";
    field public static final String ACCESS_NETWORK_CONDITIONS = "android.permission.ACCESS_NETWORK_CONDITIONS";
    field public static final String ACCESS_NOTIFICATIONS = "android.permission.ACCESS_NOTIFICATIONS";
    field public static final String ACCESS_SHORTCUTS = "android.permission.ACCESS_SHORTCUTS";
    field public static final String ACCESS_SURFACE_FLINGER = "android.permission.ACCESS_SURFACE_FLINGER";
    field public static final String ACTIVITY_EMBEDDING = "android.permission.ACTIVITY_EMBEDDING";
    field public static final String ALLOCATE_AGGRESSIVE = "android.permission.ALLOCATE_AGGRESSIVE";
    field public static final String ALLOW_ANY_CODEC_FOR_PLAYBACK = "android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK";
    field public static final String BACKUP = "android.permission.BACKUP";
    field @Deprecated public static final String BIND_CONNECTION_SERVICE = "android.permission.BIND_CONNECTION_SERVICE";
    field public static final String BIND_DIRECTORY_SEARCH = "android.permission.BIND_DIRECTORY_SEARCH";
    field public static final String BIND_EUICC_SERVICE = "android.permission.BIND_EUICC_SERVICE";
    field public static final String BIND_IMS_SERVICE = "android.permission.BIND_IMS_SERVICE";
    field public static final String BIND_KEYGUARD_APPWIDGET = "android.permission.BIND_KEYGUARD_APPWIDGET";
    field public static final String BIND_NETWORK_RECOMMENDATION_SERVICE = "android.permission.BIND_NETWORK_RECOMMENDATION_SERVICE";
    field public static final String BIND_NOTIFICATION_ASSISTANT_SERVICE = "android.permission.BIND_NOTIFICATION_ASSISTANT_SERVICE";
    field public static final String BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE = "android.permission.BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE";
    field public static final String BIND_PRINT_RECOMMENDATION_SERVICE = "android.permission.BIND_PRINT_RECOMMENDATION_SERVICE";
    field public static final String BIND_RESOLVER_RANKER_SERVICE = "android.permission.BIND_RESOLVER_RANKER_SERVICE";
    field public static final String BIND_RUNTIME_PERMISSION_PRESENTER_SERVICE = "android.permission.BIND_RUNTIME_PERMISSION_PRESENTER_SERVICE";
    field public static final String BIND_SETTINGS_SUGGESTIONS_SERVICE = "android.permission.BIND_SETTINGS_SUGGESTIONS_SERVICE";
    field public static final String BIND_SOUND_TRIGGER_DETECTION_SERVICE = "android.permission.BIND_SOUND_TRIGGER_DETECTION_SERVICE";
    field public static final String BIND_TELEPHONY_DATA_SERVICE = "android.permission.BIND_TELEPHONY_DATA_SERVICE";
    field public static final String BIND_TELEPHONY_NETWORK_SERVICE = "android.permission.BIND_TELEPHONY_NETWORK_SERVICE";
    field public static final String BIND_TEXTCLASSIFIER_SERVICE = "android.permission.BIND_TEXTCLASSIFIER_SERVICE";
    field public static final String BIND_TRUST_AGENT = "android.permission.BIND_TRUST_AGENT";
    field public static final String BIND_TV_REMOTE_SERVICE = "android.permission.BIND_TV_REMOTE_SERVICE";
    field public static final String BRICK = "android.permission.BRICK";
    field public static final String BRIGHTNESS_SLIDER_USAGE = "android.permission.BRIGHTNESS_SLIDER_USAGE";
    field @Deprecated public static final String BROADCAST_NETWORK_PRIVILEGED = "android.permission.BROADCAST_NETWORK_PRIVILEGED";
    field public static final String CAMERA_DISABLE_TRANSMIT_LED = "android.permission.CAMERA_DISABLE_TRANSMIT_LED";
    field public static final String CAPTURE_AUDIO_HOTWORD = "android.permission.CAPTURE_AUDIO_HOTWORD";
    field public static final String CAPTURE_TV_INPUT = "android.permission.CAPTURE_TV_INPUT";
    field public static final String CHANGE_APP_IDLE_STATE = "android.permission.CHANGE_APP_IDLE_STATE";
    field public static final String CHANGE_DEVICE_IDLE_TEMP_WHITELIST = "android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST";
    field public static final String CLEAR_APP_USER_DATA = "android.permission.CLEAR_APP_USER_DATA";
    field public static final String CONFIGURE_DISPLAY_BRIGHTNESS = "android.permission.CONFIGURE_DISPLAY_BRIGHTNESS";
    field public static final String CONNECTIVITY_INTERNAL = "android.permission.CONNECTIVITY_INTERNAL";
    field public static final String CONNECTIVITY_USE_RESTRICTED_NETWORKS = "android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS";
    field public static final String CONTROL_DISPLAY_SATURATION = "android.permission.CONTROL_DISPLAY_SATURATION";
    field public static final String CONTROL_INCALL_EXPERIENCE = "android.permission.CONTROL_INCALL_EXPERIENCE";
    field public static final String CONTROL_VPN = "android.permission.CONTROL_VPN";
    field public static final String CRYPT_KEEPER = "android.permission.CRYPT_KEEPER";
    field public static final String DEVICE_POWER = "android.permission.DEVICE_POWER";
    field public static final String DISPATCH_PROVISIONING_MESSAGE = "android.permission.DISPATCH_PROVISIONING_MESSAGE";
    field public static final String FORCE_BACK = "android.permission.FORCE_BACK";
    field public static final String FORCE_STOP_PACKAGES = "android.permission.FORCE_STOP_PACKAGES";
    field public static final String GET_APP_OPS_STATS = "android.permission.GET_APP_OPS_STATS";
    field public static final String GET_PROCESS_STATE_AND_OOM_SCORE = "android.permission.GET_PROCESS_STATE_AND_OOM_SCORE";
    field public static final String GET_TOP_ACTIVITY_INFO = "android.permission.GET_TOP_ACTIVITY_INFO";
    field public static final String GRANT_RUNTIME_PERMISSIONS = "android.permission.GRANT_RUNTIME_PERMISSIONS";
    field public static final String HARDWARE_TEST = "android.permission.HARDWARE_TEST";
    field public static final String HDMI_CEC = "android.permission.HDMI_CEC";
    field public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS";
    field public static final String INJECT_EVENTS = "android.permission.INJECT_EVENTS";
    field public static final String INSTALL_GRANT_RUNTIME_PERMISSIONS = "android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS";
    field public static final String INSTALL_PACKAGE_UPDATES = "android.permission.INSTALL_PACKAGE_UPDATES";
    field public static final String INSTALL_SELF_UPDATES = "android.permission.INSTALL_SELF_UPDATES";
    field public static final String INTENT_FILTER_VERIFICATION_AGENT = "android.permission.INTENT_FILTER_VERIFICATION_AGENT";
    field public static final String INTERACT_ACROSS_USERS = "android.permission.INTERACT_ACROSS_USERS";
    field public static final String INTERACT_ACROSS_USERS_FULL = "android.permission.INTERACT_ACROSS_USERS_FULL";
    field public static final String INTERNAL_SYSTEM_WINDOW = "android.permission.INTERNAL_SYSTEM_WINDOW";
    field public static final String INVOKE_CARRIER_SETUP = "android.permission.INVOKE_CARRIER_SETUP";
    field public static final String KILL_UID = "android.permission.KILL_UID";
    field public static final String LOCAL_MAC_ADDRESS = "android.permission.LOCAL_MAC_ADDRESS";
    field public static final String LOOP_RADIO = "android.permission.LOOP_RADIO";
    field public static final String MANAGE_ACTIVITY_STACKS = "android.permission.MANAGE_ACTIVITY_STACKS";
    field public static final String MANAGE_APP_OPS_RESTRICTIONS = "android.permission.MANAGE_APP_OPS_RESTRICTIONS";
    field public static final String MANAGE_APP_TOKENS = "android.permission.MANAGE_APP_TOKENS";
    field public static final String MANAGE_AUTO_FILL = "android.permission.MANAGE_AUTO_FILL";
    field public static final String MANAGE_CARRIER_OEM_UNLOCK_STATE = "android.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE";
    field public static final String MANAGE_CA_CERTIFICATES = "android.permission.MANAGE_CA_CERTIFICATES";
    field public static final String MANAGE_DEVICE_ADMINS = "android.permission.MANAGE_DEVICE_ADMINS";
    field public static final String MANAGE_IPSEC_TUNNELS = "android.permission.MANAGE_IPSEC_TUNNELS";
    field public static final String MANAGE_SOUND_TRIGGER = "android.permission.MANAGE_SOUND_TRIGGER";
    field public static final String MANAGE_SUBSCRIPTION_PLANS = "android.permission.MANAGE_SUBSCRIPTION_PLANS";
    field public static final String MANAGE_USB = "android.permission.MANAGE_USB";
    field public static final String MANAGE_USERS = "android.permission.MANAGE_USERS";
    field public static final String MANAGE_USER_OEM_UNLOCK_STATE = "android.permission.MANAGE_USER_OEM_UNLOCK_STATE";
    field public static final String MODIFY_APPWIDGET_BIND_PERMISSIONS = "android.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS";
    field public static final String MODIFY_AUDIO_ROUTING = "android.permission.MODIFY_AUDIO_ROUTING";
    field public static final String MODIFY_CELL_BROADCASTS = "android.permission.MODIFY_CELL_BROADCASTS";
    field public static final String MODIFY_DAY_NIGHT_MODE = "android.permission.MODIFY_DAY_NIGHT_MODE";
    field @Deprecated public static final String MODIFY_NETWORK_ACCOUNTING = "android.permission.MODIFY_NETWORK_ACCOUNTING";
    field public static final String MODIFY_PARENTAL_CONTROLS = "android.permission.MODIFY_PARENTAL_CONTROLS";
    field public static final String MODIFY_QUIET_MODE = "android.permission.MODIFY_QUIET_MODE";
    field public static final String MOVE_PACKAGE = "android.permission.MOVE_PACKAGE";
    field public static final String NETWORK_SETUP_WIZARD = "android.permission.NETWORK_SETUP_WIZARD";
    field public static final String NOTIFICATION_DURING_SETUP = "android.permission.NOTIFICATION_DURING_SETUP";
    field public static final String NOTIFY_TV_INPUTS = "android.permission.NOTIFY_TV_INPUTS";
    field public static final String OBSERVE_APP_USAGE = "android.permission.OBSERVE_APP_USAGE";
    field public static final String OVERRIDE_WIFI_CONFIG = "android.permission.OVERRIDE_WIFI_CONFIG";
    field public static final String PACKAGE_VERIFICATION_AGENT = "android.permission.PACKAGE_VERIFICATION_AGENT";
    field public static final String PACKET_KEEPALIVE_OFFLOAD = "android.permission.PACKET_KEEPALIVE_OFFLOAD";
    field public static final String PEERS_MAC_ADDRESS = "android.permission.PEERS_MAC_ADDRESS";
    field public static final String PERFORM_CDMA_PROVISIONING = "android.permission.PERFORM_CDMA_PROVISIONING";
    field public static final String PERFORM_SIM_ACTIVATION = "android.permission.PERFORM_SIM_ACTIVATION";
    field public static final String PROVIDE_RESOLVER_RANKER_SERVICE = "android.permission.PROVIDE_RESOLVER_RANKER_SERVICE";
    field public static final String PROVIDE_TRUST_AGENT = "android.permission.PROVIDE_TRUST_AGENT";
    field public static final String QUERY_TIME_ZONE_RULES = "android.permission.QUERY_TIME_ZONE_RULES";
    field public static final String READ_CONTENT_RATING_SYSTEMS = "android.permission.READ_CONTENT_RATING_SYSTEMS";
    field public static final String READ_DREAM_STATE = "android.permission.READ_DREAM_STATE";
    field public static final String READ_INSTALL_SESSIONS = "android.permission.READ_INSTALL_SESSIONS";
    field public static final String READ_NETWORK_USAGE_HISTORY = "android.permission.READ_NETWORK_USAGE_HISTORY";
    field public static final String READ_OEM_UNLOCK_STATE = "android.permission.READ_OEM_UNLOCK_STATE";
    field public static final String READ_PRINT_SERVICES = "android.permission.READ_PRINT_SERVICES";
    field public static final String READ_PRINT_SERVICE_RECOMMENDATIONS = "android.permission.READ_PRINT_SERVICE_RECOMMENDATIONS";
    field public static final String READ_PRIVILEGED_PHONE_STATE = "android.permission.READ_PRIVILEGED_PHONE_STATE";
    field public static final String READ_RUNTIME_PROFILES = "android.permission.READ_RUNTIME_PROFILES";
    field public static final String READ_SEARCH_INDEXABLES = "android.permission.READ_SEARCH_INDEXABLES";
    field public static final String READ_SYSTEM_UPDATE_INFO = "android.permission.READ_SYSTEM_UPDATE_INFO";
    field public static final String READ_WALLPAPER_INTERNAL = "android.permission.READ_WALLPAPER_INTERNAL";
    field public static final String READ_WIFI_CREDENTIAL = "android.permission.READ_WIFI_CREDENTIAL";
    field public static final String REAL_GET_TASKS = "android.permission.REAL_GET_TASKS";
    field public static final String RECEIVE_DATA_ACTIVITY_CHANGE = "android.permission.RECEIVE_DATA_ACTIVITY_CHANGE";
    field public static final String RECEIVE_EMERGENCY_BROADCAST = "android.permission.RECEIVE_EMERGENCY_BROADCAST";
    field public static final String RECEIVE_WIFI_CREDENTIAL_CHANGE = "android.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE";
    field public static final String RECOVERY = "android.permission.RECOVERY";
    field public static final String RECOVER_KEYSTORE = "android.permission.RECOVER_KEYSTORE";
    field public static final String REGISTER_CALL_PROVIDER = "android.permission.REGISTER_CALL_PROVIDER";
    field public static final String REGISTER_CONNECTION_MANAGER = "android.permission.REGISTER_CONNECTION_MANAGER";
    field public static final String REGISTER_SIM_SUBSCRIPTION = "android.permission.REGISTER_SIM_SUBSCRIPTION";
    field public static final String REMOVE_DRM_CERTIFICATES = "android.permission.REMOVE_DRM_CERTIFICATES";
    field public static final String RESTRICTED_VR_ACCESS = "android.permission.RESTRICTED_VR_ACCESS";
    field public static final String RETRIEVE_WINDOW_CONTENT = "android.permission.RETRIEVE_WINDOW_CONTENT";
    field public static final String REVOKE_RUNTIME_PERMISSIONS = "android.permission.REVOKE_RUNTIME_PERMISSIONS";
    field public static final String SCORE_NETWORKS = "android.permission.SCORE_NETWORKS";
    field public static final String SEND_SHOW_SUSPENDED_APP_DETAILS = "android.permission.SEND_SHOW_SUSPENDED_APP_DETAILS";
    field public static final String SEND_SMS_NO_CONFIRMATION = "android.permission.SEND_SMS_NO_CONFIRMATION";
    field public static final String SERIAL_PORT = "android.permission.SERIAL_PORT";
    field public static final String SET_ACTIVITY_WATCHER = "android.permission.SET_ACTIVITY_WATCHER";
    field public static final String SET_HARMFUL_APP_WARNINGS = "android.permission.SET_HARMFUL_APP_WARNINGS";
    field public static final String SET_MEDIA_KEY_LISTENER = "android.permission.SET_MEDIA_KEY_LISTENER";
    field public static final String SET_ORIENTATION = "android.permission.SET_ORIENTATION";
    field public static final String SET_POINTER_SPEED = "android.permission.SET_POINTER_SPEED";
    field public static final String SET_SCREEN_COMPATIBILITY = "android.permission.SET_SCREEN_COMPATIBILITY";
    field public static final String SET_VOLUME_KEY_LONG_PRESS_LISTENER = "android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER";
    field public static final String SET_WALLPAPER_COMPONENT = "android.permission.SET_WALLPAPER_COMPONENT";
    field public static final String SHOW_KEYGUARD_MESSAGE = "android.permission.SHOW_KEYGUARD_MESSAGE";
    field public static final String SHUTDOWN = "android.permission.SHUTDOWN";
    field public static final String STOP_APP_SWITCHES = "android.permission.STOP_APP_SWITCHES";
    field public static final String SUBSTITUTE_NOTIFICATION_APP_NAME = "android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME";
    field public static final String SUSPEND_APPS = "android.permission.SUSPEND_APPS";
    field public static final String TETHER_PRIVILEGED = "android.permission.TETHER_PRIVILEGED";
    field public static final String TV_INPUT_HARDWARE = "android.permission.TV_INPUT_HARDWARE";
    field public static final String TV_VIRTUAL_REMOTE_CONTROLLER = "android.permission.TV_VIRTUAL_REMOTE_CONTROLLER";
    field public static final String UNLIMITED_SHORTCUTS_API_CALLS = "android.permission.UNLIMITED_SHORTCUTS_API_CALLS";
    field public static final String UPDATE_APP_OPS_STATS = "android.permission.UPDATE_APP_OPS_STATS";
    field public static final String UPDATE_LOCK = "android.permission.UPDATE_LOCK";
    field public static final String UPDATE_TIME_ZONE_RULES = "android.permission.UPDATE_TIME_ZONE_RULES";
    field public static final String USER_ACTIVITY = "android.permission.USER_ACTIVITY";
    field public static final String USE_RESERVED_DISK = "android.permission.USE_RESERVED_DISK";
    field public static final String WRITE_DREAM_STATE = "android.permission.WRITE_DREAM_STATE";
    field public static final String WRITE_EMBEDDED_SUBSCRIPTIONS = "android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS";
    field public static final String WRITE_MEDIA_STORAGE = "android.permission.WRITE_MEDIA_STORAGE";
  }

  public static final class R.array {
    field public static final int config_keySystemUuidMapping = 17235973; // 0x1070005
  }

  public static final class R.attr {
    field public static final int isVrOnly = 16844152; // 0x1010578
    field public static final int requiredSystemPropertyName = 16844133; // 0x1010565
    field public static final int requiredSystemPropertyValue = 16844134; // 0x1010566
    field public static final int userRestriction = 16844164; // 0x1010584
  }

  public static final class R.raw {
    field public static final int loaderror = 17825792; // 0x1100000
    field public static final int nodomain = 17825793; // 0x1100001
  }

  public static final class R.style {
    field public static final int Theme_Leanback_FormWizard = 16974544; // 0x10302d0
  }

}

package android.accounts {

  public class AccountManager {
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public android.accounts.AccountManagerFuture<android.os.Bundle> finishSessionAsUser(android.os.Bundle, android.app.Activity, android.os.UserHandle, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler);
  }

}

package android.app {

  public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
    method public void convertFromTranslucent();
    method public boolean convertToTranslucent(android.app.Activity.TranslucentConversionListener, android.app.ActivityOptions);
    method @Deprecated public boolean isBackgroundVisibleBehind();
    method @Deprecated public void onBackgroundVisibleBehindChanged(boolean);
  }

  public static interface Activity.TranslucentConversionListener {
    method public void onTranslucentConversionComplete(boolean);
  }

  public class ActivityManager {
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void addOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener, int);
    method @RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) public void forceStopPackage(String);
    method @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public static int getCurrentUser();
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getPackageImportance(String);
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getUidImportance(int);
    method @RequiresPermission(android.Manifest.permission.KILL_UID) public void killUid(int, String);
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void removeOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener);
  }

  public static interface ActivityManager.OnUidImportanceListener {
    method public void onUidImportance(int, int);
  }

  public class AlarmManager {
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void set(int, long, long, long, android.app.PendingIntent, android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void set(int, long, long, long, android.app.AlarmManager.OnAlarmListener, android.os.Handler, android.os.WorkSource);
  }

  public class AppOpsManager {
    method public static String[] getOpStrs();
    method @RequiresPermission("android.permission.MANAGE_APP_OPS_MODES") public void setMode(String, int, String, int);
    method @RequiresPermission("android.permission.MANAGE_APP_OPS_MODES") public void setUidMode(String, int, int);
    field public static final String OPSTR_ACCEPT_HANDOVER = "android:accept_handover";
    field public static final String OPSTR_ACCESS_NOTIFICATIONS = "android:access_notifications";
    field public static final String OPSTR_ACTIVATE_VPN = "android:activate_vpn";
    field public static final String OPSTR_ASSIST_SCREENSHOT = "android:assist_screenshot";
    field public static final String OPSTR_ASSIST_STRUCTURE = "android:assist_structure";
    field public static final String OPSTR_AUDIO_ACCESSIBILITY_VOLUME = "android:audio_accessibility_volume";
    field public static final String OPSTR_AUDIO_ALARM_VOLUME = "android:audio_alarm_volume";
    field public static final String OPSTR_AUDIO_BLUETOOTH_VOLUME = "android:audio_bluetooth_volume";
    field public static final String OPSTR_AUDIO_MASTER_VOLUME = "android:audio_master_volume";
    field public static final String OPSTR_AUDIO_MEDIA_VOLUME = "android:audio_media_volume";
    field public static final String OPSTR_AUDIO_NOTIFICATION_VOLUME = "android:audio_notification_volume";
    field public static final String OPSTR_AUDIO_RING_VOLUME = "android:audio_ring_volume";
    field public static final String OPSTR_AUDIO_VOICE_VOLUME = "android:audio_voice_volume";
    field public static final String OPSTR_BIND_ACCESSIBILITY_SERVICE = "android:bind_accessibility_service";
    field public static final String OPSTR_CHANGE_WIFI_STATE = "android:change_wifi_state";
    field public static final String OPSTR_GET_ACCOUNTS = "android:get_accounts";
    field public static final String OPSTR_GPS = "android:gps";
    field public static final String OPSTR_INSTANT_APP_START_FOREGROUND = "android:instant_app_start_foreground";
    field public static final String OPSTR_MANAGE_IPSEC_TUNNELS = "android:manage_ipsec_tunnels";
    field public static final String OPSTR_MUTE_MICROPHONE = "android:mute_microphone";
    field public static final String OPSTR_NEIGHBORING_CELLS = "android:neighboring_cells";
    field public static final String OPSTR_PLAY_AUDIO = "android:play_audio";
    field public static final String OPSTR_POST_NOTIFICATION = "android:post_notification";
    field public static final String OPSTR_PROJECT_MEDIA = "android:project_media";
    field public static final String OPSTR_READ_CLIPBOARD = "android:read_clipboard";
    field public static final String OPSTR_READ_ICC_SMS = "android:read_icc_sms";
    field public static final String OPSTR_RECEIVE_EMERGENCY_BROADCAST = "android:receive_emergency_broadcast";
    field public static final String OPSTR_REQUEST_DELETE_PACKAGES = "android:request_delete_packages";
    field public static final String OPSTR_REQUEST_INSTALL_PACKAGES = "android:request_install_packages";
    field public static final String OPSTR_RUN_ANY_IN_BACKGROUND = "android:run_any_in_background";
    field public static final String OPSTR_RUN_IN_BACKGROUND = "android:run_in_background";
    field public static final String OPSTR_START_FOREGROUND = "android:start_foreground";
    field public static final String OPSTR_TAKE_AUDIO_FOCUS = "android:take_audio_focus";
    field public static final String OPSTR_TAKE_MEDIA_BUTTONS = "android:take_media_buttons";
    field public static final String OPSTR_TOAST_WINDOW = "android:toast_window";
    field public static final String OPSTR_TURN_SCREEN_ON = "android:turn_screen_on";
    field public static final String OPSTR_VIBRATE = "android:vibrate";
    field public static final String OPSTR_WAKE_LOCK = "android:wake_lock";
    field public static final String OPSTR_WIFI_SCAN = "android:wifi_scan";
    field public static final String OPSTR_WRITE_CLIPBOARD = "android:write_clipboard";
    field public static final String OPSTR_WRITE_ICC_SMS = "android:write_icc_sms";
    field public static final String OPSTR_WRITE_SMS = "android:write_sms";
    field public static final String OPSTR_WRITE_WALLPAPER = "android:write_wallpaper";
  }

  public class BroadcastOptions {
    method public static android.app.BroadcastOptions makeBasic();
    method public void setDontSendToRestrictedApps(boolean);
    method @RequiresPermission(android.Manifest.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST) public void setTemporaryAppWhitelistDuration(long);
    method public android.os.Bundle toBundle();
  }

  public class DownloadManager {
    field public static final String ACTION_DOWNLOAD_COMPLETED = "android.intent.action.DOWNLOAD_COMPLETED";
  }

  public abstract class InstantAppResolverService extends android.app.Service {
    ctor public InstantAppResolverService();
    method public final void attachBaseContext(android.content.Context);
    method public final android.os.IBinder onBind(android.content.Intent);
    method @Deprecated public void onGetInstantAppIntentFilter(int[], String, android.app.InstantAppResolverService.InstantAppResolutionCallback);
    method public void onGetInstantAppIntentFilter(android.content.Intent, int[], String, android.app.InstantAppResolverService.InstantAppResolutionCallback);
    method @Deprecated public void onGetInstantAppResolveInfo(int[], String, android.app.InstantAppResolverService.InstantAppResolutionCallback);
    method public void onGetInstantAppResolveInfo(android.content.Intent, int[], String, android.app.InstantAppResolverService.InstantAppResolutionCallback);
  }

  public static final class InstantAppResolverService.InstantAppResolutionCallback {
    method public void onInstantAppResolveInfo(java.util.List<android.content.pm.InstantAppResolveInfo>);
  }

  public class KeyguardManager {
    method public android.content.Intent createConfirmFactoryResetCredentialIntent(CharSequence, CharSequence, CharSequence);
    method @RequiresPermission(android.Manifest.permission.SHOW_KEYGUARD_MESSAGE) public void requestDismissKeyguard(@NonNull android.app.Activity, @Nullable CharSequence, @Nullable android.app.KeyguardManager.KeyguardDismissCallback);
  }

  public class Notification implements android.os.Parcelable {
    field public static final String CATEGORY_CAR_EMERGENCY = "car_emergency";
    field public static final String CATEGORY_CAR_INFORMATION = "car_information";
    field public static final String CATEGORY_CAR_WARNING = "car_warning";
    field @RequiresPermission(android.Manifest.permission.NOTIFICATION_DURING_SETUP) public static final String EXTRA_ALLOW_DURING_SETUP = "android.allowDuringSetup";
    field @RequiresPermission(android.Manifest.permission.SUBSTITUTE_NOTIFICATION_APP_NAME) public static final String EXTRA_SUBSTITUTE_APP_NAME = "android.substName";
    field public static final int FLAG_AUTOGROUP_SUMMARY = 1024; // 0x400
  }

  public static final class Notification.TvExtender implements android.app.Notification.Extender {
    ctor public Notification.TvExtender();
    ctor public Notification.TvExtender(android.app.Notification);
    method public android.app.Notification.Builder extend(android.app.Notification.Builder);
    method public String getChannelId();
    method public android.app.PendingIntent getContentIntent();
    method public android.app.PendingIntent getDeleteIntent();
    method public boolean getSuppressShowOverApps();
    method public boolean isAvailableOnTv();
    method public android.app.Notification.TvExtender setChannel(String);
    method public android.app.Notification.TvExtender setChannelId(String);
    method public android.app.Notification.TvExtender setContentIntent(android.app.PendingIntent);
    method public android.app.Notification.TvExtender setDeleteIntent(android.app.PendingIntent);
    method public android.app.Notification.TvExtender setSuppressShowOverApps(boolean);
  }

  public final class NotificationChannel implements android.os.Parcelable {
    method public int getUserLockedFields();
    method public boolean isDeleted();
    method public void populateFromXml(org.xmlpull.v1.XmlPullParser);
    method public org.json.JSONObject toJson() throws org.json.JSONException;
    method public void writeXml(org.xmlpull.v1.XmlSerializer) throws java.io.IOException;
  }

  public final class NotificationChannelGroup implements android.os.Parcelable {
    method public org.json.JSONObject toJson() throws org.json.JSONException;
  }

  public final class StatsManager {
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void addConfig(long, byte[]) throws android.app.StatsManager.StatsUnavailableException;
    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean addConfiguration(long, byte[]);
    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) @Nullable public byte[] getData(long);
    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) @Nullable public byte[] getMetadata();
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getReports(long) throws android.app.StatsManager.StatsUnavailableException;
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getStatsMetadata() throws android.app.StatsManager.StatsUnavailableException;
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void removeConfig(long) throws android.app.StatsManager.StatsUnavailableException;
    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean removeConfiguration(long);
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void setBroadcastSubscriber(android.app.PendingIntent, long, long) throws android.app.StatsManager.StatsUnavailableException;
    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean setBroadcastSubscriber(long, long, android.app.PendingIntent);
    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean setDataFetchOperation(long, android.app.PendingIntent);
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void setFetchReportsOperation(android.app.PendingIntent, long) throws android.app.StatsManager.StatsUnavailableException;
    field public static final String ACTION_STATSD_STARTED = "android.app.action.STATSD_STARTED";
    field public static final String EXTRA_STATS_BROADCAST_SUBSCRIBER_COOKIES = "android.app.extra.STATS_BROADCAST_SUBSCRIBER_COOKIES";
    field public static final String EXTRA_STATS_CONFIG_KEY = "android.app.extra.STATS_CONFIG_KEY";
    field public static final String EXTRA_STATS_CONFIG_UID = "android.app.extra.STATS_CONFIG_UID";
    field public static final String EXTRA_STATS_DIMENSIONS_VALUE = "android.app.extra.STATS_DIMENSIONS_VALUE";
    field public static final String EXTRA_STATS_SUBSCRIPTION_ID = "android.app.extra.STATS_SUBSCRIPTION_ID";
    field public static final String EXTRA_STATS_SUBSCRIPTION_RULE_ID = "android.app.extra.STATS_SUBSCRIPTION_RULE_ID";
  }

  public static class StatsManager.StatsUnavailableException extends android.util.AndroidException {
    ctor public StatsManager.StatsUnavailableException(String);
    ctor public StatsManager.StatsUnavailableException(String, Throwable);
  }

  public class VrManager {
    method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public void setAndBindVrCompositor(android.content.ComponentName);
    method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public void setPersistentVrModeEnabled(boolean);
  }

  public class WallpaperManager {
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public void clearWallpaper(int, int);
    method public void setDisplayOffset(android.os.IBinder, int, int);
    method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER_COMPONENT) public boolean setWallpaperComponent(android.content.ComponentName);
  }

}

package android.app.admin {

  public class DevicePolicyManager {
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getDeviceOwner();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.content.ComponentName getDeviceOwnerComponentOnAnyUser();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getDeviceOwnerNameOnAnyUser();
    method @Nullable public CharSequence getDeviceOwnerOrganizationName();
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public java.util.List<java.lang.String> getPermittedAccessibilityServices(int);
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public java.util.List<java.lang.String> getPermittedInputMethodsForCurrentUser();
    method @Nullable public android.content.ComponentName getProfileOwner() throws java.lang.IllegalArgumentException;
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getProfileOwnerNameAsUser(int) throws java.lang.IllegalArgumentException;
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public int getUserProvisioningState();
    method public boolean isDeviceManaged();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isDeviceProvisioned();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isDeviceProvisioningConfigApplied();
    method @RequiresPermission("android.permission.NOTIFY_PENDING_SYSTEM_UPDATE") public void notifyPendingSystemUpdate(long);
    method @RequiresPermission("android.permission.NOTIFY_PENDING_SYSTEM_UPDATE") public void notifyPendingSystemUpdate(long, boolean);
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public boolean packageHasActiveAdmins(String);
    method @Deprecated @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_ADMINS) public boolean setActiveProfileOwner(@NonNull android.content.ComponentName, String) throws java.lang.IllegalArgumentException;
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void setDeviceProvisioningConfigApplied();
    field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_ALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_ALLOWED";
    field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_DISALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_DISALLOWED";
    field public static final String ACTION_PROVISION_FINALIZATION = "android.app.action.PROVISION_FINALIZATION";
    field public static final String ACTION_PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE = "android.app.action.PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE";
    field public static final String ACTION_SET_PROFILE_OWNER = "android.app.action.SET_PROFILE_OWNER";
    field public static final String ACTION_STATE_USER_SETUP_COMPLETE = "android.app.action.STATE_USER_SETUP_COMPLETE";
    field public static final String EXTRA_PROFILE_OWNER_NAME = "android.app.extra.PROFILE_OWNER_NAME";
    field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_ICON_URI = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_ICON_URI";
    field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_LABEL = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_LABEL";
    field public static final String EXTRA_PROVISIONING_ORGANIZATION_NAME = "android.app.extra.PROVISIONING_ORGANIZATION_NAME";
    field public static final String EXTRA_PROVISIONING_SUPPORT_URL = "android.app.extra.PROVISIONING_SUPPORT_URL";
    field public static final int STATE_USER_PROFILE_COMPLETE = 4; // 0x4
    field public static final int STATE_USER_SETUP_COMPLETE = 2; // 0x2
    field public static final int STATE_USER_SETUP_FINALIZED = 3; // 0x3
    field public static final int STATE_USER_SETUP_INCOMPLETE = 1; // 0x1
    field public static final int STATE_USER_UNMANAGED = 0; // 0x0
  }

  public final class SystemUpdatePolicy implements android.os.Parcelable {
    method public android.app.admin.SystemUpdatePolicy.InstallationOption getInstallationOptionAt(long);
    field public static final int TYPE_PAUSE = 4; // 0x4
  }

  public static class SystemUpdatePolicy.InstallationOption {
    method public long getEffectiveTime();
    method public int getType();
  }

}

package android.app.backup {

  public class BackupDataInput {
    ctor public BackupDataInput(java.io.FileDescriptor);
  }

  public class BackupDataOutput {
    ctor public BackupDataOutput(java.io.FileDescriptor);
    ctor public BackupDataOutput(java.io.FileDescriptor, long);
  }

  public class BackupManager {
    method @RequiresPermission(android.Manifest.permission.BACKUP) public void backupNow();
    method @RequiresPermission(android.Manifest.permission.BACKUP) public android.app.backup.RestoreSession beginRestoreSession();
    method @RequiresPermission(android.Manifest.permission.BACKUP) public void cancelBackups();
    method @RequiresPermission(android.Manifest.permission.BACKUP) public long getAvailableRestoreToken(String);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public android.content.Intent getConfigurationIntent(String);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public String getCurrentTransport();
    method @RequiresPermission(android.Manifest.permission.BACKUP) public android.content.Intent getDataManagementIntent(String);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public String getDataManagementLabel(String);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public String getDestinationString(String);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public boolean isAppEligibleForBackup(String);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public boolean isBackupEnabled();
    method @RequiresPermission(android.Manifest.permission.BACKUP) public boolean isBackupServiceActive(android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public String[] listAllTransports();
    method @RequiresPermission(android.Manifest.permission.BACKUP) public int requestBackup(String[], android.app.backup.BackupObserver);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public int requestBackup(String[], android.app.backup.BackupObserver, android.app.backup.BackupManagerMonitor, int);
    method @Deprecated public int requestRestore(android.app.backup.RestoreObserver, android.app.backup.BackupManagerMonitor);
    method @Deprecated @RequiresPermission(android.Manifest.permission.BACKUP) public String selectBackupTransport(String);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public void selectBackupTransport(android.content.ComponentName, android.app.backup.SelectBackupTransportCallback);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public void setAutoRestore(boolean);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public void setBackupEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public void updateTransportAttributes(android.content.ComponentName, String, @Nullable android.content.Intent, String, @Nullable android.content.Intent, @Nullable String);
    field public static final int ERROR_AGENT_FAILURE = -1003; // 0xfffffc15
    field public static final int ERROR_BACKUP_CANCELLED = -2003; // 0xfffff82d
    field public static final int ERROR_BACKUP_NOT_ALLOWED = -2001; // 0xfffff82f
    field public static final int ERROR_PACKAGE_NOT_FOUND = -2002; // 0xfffff82e
    field public static final int ERROR_TRANSPORT_ABORTED = -1000; // 0xfffffc18
    field public static final int ERROR_TRANSPORT_INVALID = -2; // 0xfffffffe
    field public static final int ERROR_TRANSPORT_PACKAGE_REJECTED = -1002; // 0xfffffc16
    field public static final int ERROR_TRANSPORT_QUOTA_EXCEEDED = -1005; // 0xfffffc13
    field public static final int ERROR_TRANSPORT_UNAVAILABLE = -1; // 0xffffffff
    field public static final int FLAG_NON_INCREMENTAL_BACKUP = 1; // 0x1
    field public static final String PACKAGE_MANAGER_SENTINEL = "@pm@";
    field public static final int SUCCESS = 0; // 0x0
  }

  public class BackupManagerMonitor {
    ctor public BackupManagerMonitor();
    method public void onEvent(android.os.Bundle);
    field public static final String EXTRA_LOG_CANCEL_ALL = "android.app.backup.extra.LOG_CANCEL_ALL";
    field public static final String EXTRA_LOG_EVENT_CATEGORY = "android.app.backup.extra.LOG_EVENT_CATEGORY";
    field public static final String EXTRA_LOG_EVENT_ID = "android.app.backup.extra.LOG_EVENT_ID";
    field public static final String EXTRA_LOG_EVENT_PACKAGE_LONG_VERSION = "android.app.backup.extra.LOG_EVENT_PACKAGE_FULL_VERSION";
    field public static final String EXTRA_LOG_EVENT_PACKAGE_NAME = "android.app.backup.extra.LOG_EVENT_PACKAGE_NAME";
    field @Deprecated public static final String EXTRA_LOG_EVENT_PACKAGE_VERSION = "android.app.backup.extra.LOG_EVENT_PACKAGE_VERSION";
    field public static final String EXTRA_LOG_EXCEPTION_FULL_BACKUP = "android.app.backup.extra.LOG_EXCEPTION_FULL_BACKUP";
    field public static final String EXTRA_LOG_ILLEGAL_KEY = "android.app.backup.extra.LOG_ILLEGAL_KEY";
    field public static final String EXTRA_LOG_MANIFEST_PACKAGE_NAME = "android.app.backup.extra.LOG_MANIFEST_PACKAGE_NAME";
    field public static final String EXTRA_LOG_OLD_VERSION = "android.app.backup.extra.LOG_OLD_VERSION";
    field public static final String EXTRA_LOG_POLICY_ALLOW_APKS = "android.app.backup.extra.LOG_POLICY_ALLOW_APKS";
    field public static final String EXTRA_LOG_PREFLIGHT_ERROR = "android.app.backup.extra.LOG_PREFLIGHT_ERROR";
    field public static final String EXTRA_LOG_RESTORE_ANYWAY = "android.app.backup.extra.LOG_RESTORE_ANYWAY";
    field public static final String EXTRA_LOG_RESTORE_VERSION = "android.app.backup.extra.LOG_RESTORE_VERSION";
    field public static final String EXTRA_LOG_WIDGET_PACKAGE_NAME = "android.app.backup.extra.LOG_WIDGET_PACKAGE_NAME";
    field public static final int LOG_EVENT_CATEGORY_AGENT = 2; // 0x2
    field public static final int LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY = 3; // 0x3
    field public static final int LOG_EVENT_CATEGORY_TRANSPORT = 1; // 0x1
    field public static final int LOG_EVENT_ID_APK_NOT_INSTALLED = 40; // 0x28
    field public static final int LOG_EVENT_ID_APP_HAS_NO_AGENT = 28; // 0x1c
    field public static final int LOG_EVENT_ID_BACKUP_DISABLED = 13; // 0xd
    field public static final int LOG_EVENT_ID_CANNOT_RESTORE_WITHOUT_APK = 41; // 0x29
    field public static final int LOG_EVENT_ID_CANT_FIND_AGENT = 30; // 0x1e
    field public static final int LOG_EVENT_ID_CORRUPT_MANIFEST = 46; // 0x2e
    field public static final int LOG_EVENT_ID_DEVICE_NOT_PROVISIONED = 14; // 0xe
    field public static final int LOG_EVENT_ID_ERROR_PREFLIGHT = 16; // 0x10
    field public static final int LOG_EVENT_ID_EXCEPTION_FULL_BACKUP = 19; // 0x13
    field public static final int LOG_EVENT_ID_EXPECTED_DIFFERENT_PACKAGE = 43; // 0x2b
    field public static final int LOG_EVENT_ID_FULL_BACKUP_CANCEL = 4; // 0x4
    field public static final int LOG_EVENT_ID_FULL_RESTORE_ALLOW_BACKUP_FALSE = 39; // 0x27
    field public static final int LOG_EVENT_ID_FULL_RESTORE_SIGNATURE_MISMATCH = 37; // 0x25
    field public static final int LOG_EVENT_ID_FULL_RESTORE_TIMEOUT = 45; // 0x2d
    field public static final int LOG_EVENT_ID_ILLEGAL_KEY = 5; // 0x5
    field public static final int LOG_EVENT_ID_KEY_VALUE_BACKUP_CANCEL = 21; // 0x15
    field public static final int LOG_EVENT_ID_KEY_VALUE_RESTORE_TIMEOUT = 31; // 0x1f
    field public static final int LOG_EVENT_ID_LOST_TRANSPORT = 25; // 0x19
    field public static final int LOG_EVENT_ID_MISSING_SIGNATURE = 42; // 0x2a
    field public static final int LOG_EVENT_ID_NO_DATA_TO_SEND = 7; // 0x7
    field public static final int LOG_EVENT_ID_NO_PACKAGES = 49; // 0x31
    field public static final int LOG_EVENT_ID_NO_PM_METADATA_RECEIVED = 23; // 0x17
    field public static final int LOG_EVENT_ID_NO_RESTORE_METADATA_AVAILABLE = 22; // 0x16
    field public static final int LOG_EVENT_ID_PACKAGE_INELIGIBLE = 9; // 0x9
    field public static final int LOG_EVENT_ID_PACKAGE_KEY_VALUE_PARTICIPANT = 10; // 0xa
    field public static final int LOG_EVENT_ID_PACKAGE_NOT_FOUND = 12; // 0xc
    field public static final int LOG_EVENT_ID_PACKAGE_NOT_PRESENT = 26; // 0x1a
    field public static final int LOG_EVENT_ID_PACKAGE_STOPPED = 11; // 0xb
    field public static final int LOG_EVENT_ID_PACKAGE_TRANSPORT_NOT_PRESENT = 15; // 0xf
    field public static final int LOG_EVENT_ID_PM_AGENT_HAS_NO_METADATA = 24; // 0x18
    field public static final int LOG_EVENT_ID_QUOTA_HIT_PREFLIGHT = 18; // 0x12
    field public static final int LOG_EVENT_ID_RESTORE_ANY_VERSION = 34; // 0x22
    field public static final int LOG_EVENT_ID_RESTORE_VERSION_HIGHER = 27; // 0x1b
    field public static final int LOG_EVENT_ID_SIGNATURE_MISMATCH = 29; // 0x1d
    field public static final int LOG_EVENT_ID_SYSTEM_APP_NO_AGENT = 38; // 0x26
    field public static final int LOG_EVENT_ID_TRANSPORT_IS_NULL = 50; // 0x32
    field public static final int LOG_EVENT_ID_TRANSPORT_NON_INCREMENTAL_BACKUP_REQUIRED = 51; // 0x33
    field public static final int LOG_EVENT_ID_UNKNOWN_VERSION = 44; // 0x2c
    field public static final int LOG_EVENT_ID_VERSIONS_MATCH = 35; // 0x23
    field public static final int LOG_EVENT_ID_VERSION_OF_BACKUP_OLDER = 36; // 0x24
    field public static final int LOG_EVENT_ID_WIDGET_METADATA_MISMATCH = 47; // 0x2f
    field public static final int LOG_EVENT_ID_WIDGET_UNKNOWN_VERSION = 48; // 0x30
  }

  public abstract class BackupObserver {
    ctor public BackupObserver();
    method public void backupFinished(int);
    method public void onResult(String, int);
    method public void onUpdate(String, android.app.backup.BackupProgress);
  }

  public class BackupProgress implements android.os.Parcelable {
    ctor public BackupProgress(long, long);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.backup.BackupProgress> CREATOR;
    field public final long bytesExpected;
    field public final long bytesTransferred;
  }

  public class BackupTransport {
    ctor public BackupTransport();
    method public int abortFullRestore();
    method public void cancelFullBackup();
    method public int checkFullBackupSize(long);
    method public int clearBackupData(android.content.pm.PackageInfo);
    method public android.content.Intent configurationIntent();
    method public String currentDestinationString();
    method public android.content.Intent dataManagementIntent();
    method public String dataManagementLabel();
    method public int finishBackup();
    method public void finishRestore();
    method public android.app.backup.RestoreSet[] getAvailableRestoreSets();
    method public long getBackupQuota(String, boolean);
    method public android.os.IBinder getBinder();
    method public long getCurrentRestoreSet();
    method public int getNextFullRestoreDataChunk(android.os.ParcelFileDescriptor);
    method public int getRestoreData(android.os.ParcelFileDescriptor);
    method public int getTransportFlags();
    method public int initializeDevice();
    method public boolean isAppEligibleForBackup(android.content.pm.PackageInfo, boolean);
    method public String name();
    method public android.app.backup.RestoreDescription nextRestorePackage();
    method public int performBackup(android.content.pm.PackageInfo, android.os.ParcelFileDescriptor, int);
    method public int performBackup(android.content.pm.PackageInfo, android.os.ParcelFileDescriptor);
    method public int performFullBackup(android.content.pm.PackageInfo, android.os.ParcelFileDescriptor, int);
    method public int performFullBackup(android.content.pm.PackageInfo, android.os.ParcelFileDescriptor);
    method public long requestBackupTime();
    method public long requestFullBackupTime();
    method public int sendBackupData(int);
    method public int startRestore(long, android.content.pm.PackageInfo[]);
    method public String transportDirName();
    field public static final int AGENT_ERROR = -1003; // 0xfffffc15
    field public static final int AGENT_UNKNOWN = -1004; // 0xfffffc14
    field public static final String EXTRA_TRANSPORT_REGISTRATION = "android.app.backup.extra.TRANSPORT_REGISTRATION";
    field public static final int FLAG_INCREMENTAL = 2; // 0x2
    field public static final int FLAG_NON_INCREMENTAL = 4; // 0x4
    field public static final int FLAG_USER_INITIATED = 1; // 0x1
    field public static final int NO_MORE_DATA = -1; // 0xffffffff
    field public static final int TRANSPORT_ERROR = -1000; // 0xfffffc18
    field public static final int TRANSPORT_NON_INCREMENTAL_BACKUP_REQUIRED = -1006; // 0xfffffc12
    field public static final int TRANSPORT_NOT_INITIALIZED = -1001; // 0xfffffc17
    field public static final int TRANSPORT_OK = 0; // 0x0
    field public static final int TRANSPORT_PACKAGE_REJECTED = -1002; // 0xfffffc16
    field public static final int TRANSPORT_QUOTA_EXCEEDED = -1005; // 0xfffffc13
  }

  public class RestoreDescription implements android.os.Parcelable {
    ctor public RestoreDescription(String, int);
    method public int describeContents();
    method public int getDataType();
    method public String getPackageName();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.backup.RestoreDescription> CREATOR;
    field public static final android.app.backup.RestoreDescription NO_MORE_PACKAGES;
    field public static final int TYPE_FULL_STREAM = 2; // 0x2
    field public static final int TYPE_KEY_VALUE = 1; // 0x1
  }

  public abstract class RestoreObserver {
    method public void restoreSetsAvailable(android.app.backup.RestoreSet[]);
  }

  public class RestoreSession {
    method public void endRestoreSession();
    method public int getAvailableRestoreSets(android.app.backup.RestoreObserver, android.app.backup.BackupManagerMonitor);
    method public int getAvailableRestoreSets(android.app.backup.RestoreObserver);
    method public int restoreAll(long, android.app.backup.RestoreObserver, android.app.backup.BackupManagerMonitor);
    method public int restoreAll(long, android.app.backup.RestoreObserver);
    method public int restorePackage(String, android.app.backup.RestoreObserver, android.app.backup.BackupManagerMonitor);
    method public int restorePackage(String, android.app.backup.RestoreObserver);
  }

  public class RestoreSet implements android.os.Parcelable {
    ctor public RestoreSet();
    ctor public RestoreSet(String, String, long);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.backup.RestoreSet> CREATOR;
    field public String device;
    field public String name;
    field public long token;
  }

  public abstract class SelectBackupTransportCallback {
    ctor public SelectBackupTransportCallback();
    method public void onFailure(int);
    method public void onSuccess(String);
  }

}

package android.app.job {

  public abstract class JobScheduler {
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public abstract int scheduleAsPackage(@NonNull android.app.job.JobInfo, @NonNull String, int, String);
  }

}

package android.app.usage {

  public final class CacheQuotaHint implements android.os.Parcelable {
    ctor public CacheQuotaHint(android.app.usage.CacheQuotaHint.Builder);
    method public int describeContents();
    method public long getQuota();
    method public int getUid();
    method public android.app.usage.UsageStats getUsageStats();
    method public String getVolumeUuid();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.usage.CacheQuotaHint> CREATOR;
    field public static final long QUOTA_NOT_SET = -1L; // 0xffffffffffffffffL
  }

  public static final class CacheQuotaHint.Builder {
    ctor public CacheQuotaHint.Builder();
    ctor public CacheQuotaHint.Builder(android.app.usage.CacheQuotaHint);
    method @NonNull public android.app.usage.CacheQuotaHint build();
    method @NonNull public android.app.usage.CacheQuotaHint.Builder setQuota(long);
    method @NonNull public android.app.usage.CacheQuotaHint.Builder setUid(int);
    method @NonNull public android.app.usage.CacheQuotaHint.Builder setUsageStats(@Nullable android.app.usage.UsageStats);
    method @NonNull public android.app.usage.CacheQuotaHint.Builder setVolumeUuid(@Nullable String);
  }

  public abstract class CacheQuotaService extends android.app.Service {
    ctor public CacheQuotaService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract java.util.List<android.app.usage.CacheQuotaHint> onComputeCacheQuotaHints(java.util.List<android.app.usage.CacheQuotaHint>);
    field public static final String SERVICE_INTERFACE = "android.app.usage.CacheQuotaService";
  }

  public static final class UsageEvents.Event {
    method public String getNotificationChannelId();
    field public static final int NOTIFICATION_INTERRUPTION = 12; // 0xc
    field public static final int NOTIFICATION_SEEN = 10; // 0xa
    field public static final int SLICE_PINNED = 14; // 0xe
    field public static final int SLICE_PINNED_PRIV = 13; // 0xd
    field public static final int SYSTEM_INTERACTION = 6; // 0x6
  }

  public final class UsageStats implements android.os.Parcelable {
    method public int getAppLaunchCount();
  }

  public final class UsageStatsManager {
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getAppStandbyBucket(String);
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public java.util.Map<java.lang.String,java.lang.Integer> getAppStandbyBuckets();
    method @RequiresPermission(android.Manifest.permission.OBSERVE_APP_USAGE) public void registerAppUsageObserver(int, @NonNull String[], long, @NonNull java.util.concurrent.TimeUnit, @NonNull android.app.PendingIntent);
    method @RequiresPermission(android.Manifest.permission.CHANGE_APP_IDLE_STATE) public void setAppStandbyBucket(String, int);
    method @RequiresPermission(android.Manifest.permission.CHANGE_APP_IDLE_STATE) public void setAppStandbyBuckets(java.util.Map<java.lang.String,java.lang.Integer>);
    method @RequiresPermission(android.Manifest.permission.OBSERVE_APP_USAGE) public void unregisterAppUsageObserver(int);
    method @RequiresPermission(android.Manifest.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST) public void whitelistAppTemporarily(String, long, android.os.UserHandle);
    field public static final String EXTRA_OBSERVER_ID = "android.app.usage.extra.OBSERVER_ID";
    field public static final String EXTRA_TIME_LIMIT = "android.app.usage.extra.TIME_LIMIT";
    field public static final String EXTRA_TIME_USED = "android.app.usage.extra.TIME_USED";
    field public static final int STANDBY_BUCKET_EXEMPTED = 5; // 0x5
    field public static final int STANDBY_BUCKET_NEVER = 50; // 0x32
  }

}

package android.bluetooth {

  public final class BluetoothAdapter {
    method public boolean disableBLE();
    method public boolean enableBLE();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean enableNoAutoConnect();
    method public boolean isBleScanAlwaysAvailable();
    method public boolean isLeEnabled();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean registerMetadataListener(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothAdapter.MetadataListener, android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean unregisterMetadataListener(android.bluetooth.BluetoothDevice);
    field public static final String ACTION_BLE_STATE_CHANGED = "android.bluetooth.adapter.action.BLE_STATE_CHANGED";
    field public static final String ACTION_REQUEST_BLE_SCAN_ALWAYS_AVAILABLE = "android.bluetooth.adapter.action.REQUEST_BLE_SCAN_ALWAYS_AVAILABLE";
  }

  public abstract static class BluetoothAdapter.MetadataListener {
    ctor public BluetoothAdapter.MetadataListener();
    method public void onMetadataChanged(android.bluetooth.BluetoothDevice, int, String);
  }

  public final class BluetoothDevice implements android.os.Parcelable {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean cancelBondProcess();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public String getMetadata(int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean getSilenceMode();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isConnected();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isEncrypted();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean removeBond();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setMetadata(int, String);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setPhonebookAccessPermission(int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setSilenceMode(boolean);
    field public static final int ACCESS_ALLOWED = 1; // 0x1
    field public static final int ACCESS_REJECTED = 2; // 0x2
    field public static final int ACCESS_UNKNOWN = 0; // 0x0
    field public static final String ACTION_SILENCE_MODE_CHANGED = "android.bluetooth.device.action.SILENCE_MODE_CHANGED";
    field public static final String EXTRA_SILENCE_ENABLED = "android.bluetooth.device.extra.SILENCE_ENABLED";
    field public static final int METADATA_COMPANION_APP = 4; // 0x4
    field public static final int METADATA_ENHANCED_SETTINGS_UI_URI = 16; // 0x10
    field public static final int METADATA_HARDWARE_VERSION = 3; // 0x3
    field public static final int METADATA_IS_UNTHETHERED_HEADSET = 6; // 0x6
    field public static final int METADATA_MAIN_ICON = 5; // 0x5
    field public static final int METADATA_MANUFACTURER_NAME = 0; // 0x0
    field public static final int METADATA_MAX_LENGTH = 2048; // 0x800
    field public static final int METADATA_MODEL_NAME = 1; // 0x1
    field public static final int METADATA_SOFTWARE_VERSION = 2; // 0x2
    field public static final int METADATA_UNTHETHERED_CASE_BATTERY = 12; // 0xc
    field public static final int METADATA_UNTHETHERED_CASE_CHARGING = 15; // 0xf
    field public static final int METADATA_UNTHETHERED_CASE_ICON = 9; // 0x9
    field public static final int METADATA_UNTHETHERED_LEFT_BATTERY = 10; // 0xa
    field public static final int METADATA_UNTHETHERED_LEFT_CHARGING = 13; // 0xd
    field public static final int METADATA_UNTHETHERED_LEFT_ICON = 7; // 0x7
    field public static final int METADATA_UNTHETHERED_RIGHT_BATTERY = 11; // 0xb
    field public static final int METADATA_UNTHETHERED_RIGHT_CHARGING = 14; // 0xe
    field public static final int METADATA_UNTHETHERED_RIGHT_ICON = 8; // 0x8
  }

  public final class BluetoothHeadset implements android.bluetooth.BluetoothProfile {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean connect(android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean disconnect(android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setPriority(android.bluetooth.BluetoothDevice, int);
  }

  public interface BluetoothProfile {
    field public static final int PRIORITY_OFF = 0; // 0x0
    field public static final int PRIORITY_ON = 100; // 0x64
  }

}

package android.bluetooth.le {

  public final class BluetoothLeScanner {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADMIN, android.Manifest.permission.UPDATE_DEVICE_STATS}) public void startScanFromSource(android.os.WorkSource, android.bluetooth.le.ScanCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADMIN, android.Manifest.permission.UPDATE_DEVICE_STATS}) public void startScanFromSource(java.util.List<android.bluetooth.le.ScanFilter>, android.bluetooth.le.ScanSettings, android.os.WorkSource, android.bluetooth.le.ScanCallback);
    method public void startTruncatedScan(java.util.List<android.bluetooth.le.TruncatedFilter>, android.bluetooth.le.ScanSettings, android.bluetooth.le.ScanCallback);
  }

  public final class ResultStorageDescriptor implements android.os.Parcelable {
    ctor public ResultStorageDescriptor(int, int, int);
    method public int describeContents();
    method public int getLength();
    method public int getOffset();
    method public int getType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.ResultStorageDescriptor> CREATOR;
  }

  public final class ScanSettings implements android.os.Parcelable {
    field public static final int SCAN_RESULT_TYPE_ABBREVIATED = 1; // 0x1
    field public static final int SCAN_RESULT_TYPE_FULL = 0; // 0x0
  }

  public static final class ScanSettings.Builder {
    method public android.bluetooth.le.ScanSettings.Builder setScanResultType(int);
  }

  public final class TruncatedFilter {
    ctor public TruncatedFilter(android.bluetooth.le.ScanFilter, java.util.List<android.bluetooth.le.ResultStorageDescriptor>);
    method public android.bluetooth.le.ScanFilter getFilter();
    method public java.util.List<android.bluetooth.le.ResultStorageDescriptor> getStorageDescriptors();
  }

}

package android.content {

  public abstract class Context {
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public boolean bindServiceAsUser(@RequiresPermission android.content.Intent, android.content.ServiceConnection, int, android.os.UserHandle);
    method public abstract android.content.Context createCredentialProtectedStorageContext();
    method public android.content.Context createPackageContextAsUser(String, int, android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
    method @Nullable public abstract java.io.File getPreloadsFileCache();
    method public abstract boolean isCredentialProtectedStorage();
    method public abstract void sendBroadcast(android.content.Intent, @Nullable String, @Nullable android.os.Bundle);
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public abstract void sendBroadcastAsUser(@RequiresPermission android.content.Intent, android.os.UserHandle, @Nullable String, @Nullable android.os.Bundle);
    method public abstract void sendOrderedBroadcast(@NonNull android.content.Intent, @Nullable String, @Nullable android.os.Bundle, @Nullable android.content.BroadcastReceiver, @Nullable android.os.Handler, int, @Nullable String, @Nullable android.os.Bundle);
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public void startActivityAsUser(@RequiresPermission android.content.Intent, android.os.UserHandle);
    field public static final String BACKUP_SERVICE = "backup";
    field public static final String CONTEXTHUB_SERVICE = "contexthub";
    field public static final String DYNAMIC_ANDROID_SERVICE = "dynamic_android";
    field public static final String EUICC_CARD_SERVICE = "euicc_card";
    field public static final String HDMI_CONTROL_SERVICE = "hdmi_control";
    field public static final String NETD_SERVICE = "netd";
    field public static final String NETWORK_SCORE_SERVICE = "network_score";
    field public static final String OEM_LOCK_SERVICE = "oem_lock";
    field public static final String PERSISTENT_DATA_BLOCK_SERVICE = "persistent_data_block";
    field public static final String SECURE_ELEMENT_SERVICE = "secure_element";
    field public static final String STATS_MANAGER = "stats";
    field public static final String SYSTEM_UPDATE_SERVICE = "system_update";
    field public static final String VR_SERVICE = "vrmanager";
    field @Deprecated public static final String WIFI_RTT_SERVICE = "rttmanager";
    field public static final String WIFI_SCANNING_SERVICE = "wifiscanner";
  }

  public class ContextWrapper extends android.content.Context {
    method public android.content.Context createCredentialProtectedStorageContext();
    method public java.io.File getPreloadsFileCache();
    method public boolean isCredentialProtectedStorage();
    method public void sendBroadcast(android.content.Intent, String, android.os.Bundle);
    method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, String, android.os.Bundle);
    method public void sendOrderedBroadcast(android.content.Intent, String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, String, android.os.Bundle);
  }

  public class DynamicAndroidClient {
    ctor public DynamicAndroidClient(@NonNull android.content.Context);
    method public void bind();
    method public void setOnStatusChangedListener(@NonNull android.content.DynamicAndroidClient.OnStatusChangedListener, @NonNull java.util.concurrent.Executor);
    method public void setOnStatusChangedListener(@NonNull android.content.DynamicAndroidClient.OnStatusChangedListener);
    method public void start(String, long);
    method public void start(String, long, long);
    method public void unbind();
    field public static final int CAUSE_ERROR_EXCEPTION = 6; // 0x6
    field public static final int CAUSE_ERROR_INVALID_URL = 4; // 0x4
    field public static final int CAUSE_ERROR_IO = 3; // 0x3
    field public static final int CAUSE_ERROR_IPC = 5; // 0x5
    field public static final int CAUSE_INSTALL_CANCELLED = 2; // 0x2
    field public static final int CAUSE_INSTALL_COMPLETED = 1; // 0x1
    field public static final int CAUSE_NOT_SPECIFIED = 0; // 0x0
    field public static final int STATUS_IN_PROGRESS = 2; // 0x2
    field public static final int STATUS_IN_USE = 4; // 0x4
    field public static final int STATUS_NOT_STARTED = 1; // 0x1
    field public static final int STATUS_READY = 3; // 0x3
    field public static final int STATUS_UNKNOWN = 0; // 0x0
  }

  public static interface DynamicAndroidClient.OnStatusChangedListener {
    method public void onStatusChanged(int, int, long);
  }

  public class Intent implements java.lang.Cloneable android.os.Parcelable {
    field public static final String ACTION_BATTERY_LEVEL_CHANGED = "android.intent.action.BATTERY_LEVEL_CHANGED";
    field public static final String ACTION_CALL_EMERGENCY = "android.intent.action.CALL_EMERGENCY";
    field public static final String ACTION_CALL_PRIVILEGED = "android.intent.action.CALL_PRIVILEGED";
    field public static final String ACTION_FACTORY_RESET = "android.intent.action.FACTORY_RESET";
    field public static final String ACTION_GLOBAL_BUTTON = "android.intent.action.GLOBAL_BUTTON";
    field public static final String ACTION_INSTALL_INSTANT_APP_PACKAGE = "android.intent.action.INSTALL_INSTANT_APP_PACKAGE";
    field public static final String ACTION_INSTANT_APP_RESOLVER_SETTINGS = "android.intent.action.INSTANT_APP_RESOLVER_SETTINGS";
    field public static final String ACTION_INTENT_FILTER_NEEDS_VERIFICATION = "android.intent.action.INTENT_FILTER_NEEDS_VERIFICATION";
    field public static final String ACTION_MANAGE_APP_PERMISSIONS = "android.intent.action.MANAGE_APP_PERMISSIONS";
    field public static final String ACTION_MANAGE_PERMISSIONS = "android.intent.action.MANAGE_PERMISSIONS";
    field public static final String ACTION_MANAGE_PERMISSION_APPS = "android.intent.action.MANAGE_PERMISSION_APPS";
    field public static final String ACTION_MASTER_CLEAR_NOTIFICATION = "android.intent.action.MASTER_CLEAR_NOTIFICATION";
    field public static final String ACTION_PRE_BOOT_COMPLETED = "android.intent.action.PRE_BOOT_COMPLETED";
    field public static final String ACTION_QUERY_PACKAGE_RESTART = "android.intent.action.QUERY_PACKAGE_RESTART";
    field public static final String ACTION_RESOLVE_INSTANT_APP_PACKAGE = "android.intent.action.RESOLVE_INSTANT_APP_PACKAGE";
    field public static final String ACTION_REVIEW_PERMISSIONS = "android.intent.action.REVIEW_PERMISSIONS";
    field public static final String ACTION_SHOW_SUSPENDED_APP_DETAILS = "android.intent.action.SHOW_SUSPENDED_APP_DETAILS";
    field @Deprecated public static final String ACTION_SIM_STATE_CHANGED = "android.intent.action.SIM_STATE_CHANGED";
    field public static final String ACTION_SPLIT_CONFIGURATION_CHANGED = "android.intent.action.SPLIT_CONFIGURATION_CHANGED";
    field public static final String ACTION_UPGRADE_SETUP = "android.intent.action.UPGRADE_SETUP";
    field public static final String ACTION_USER_REMOVED = "android.intent.action.USER_REMOVED";
    field public static final String ACTION_VOICE_ASSIST = "android.intent.action.VOICE_ASSIST";
    field public static final String CATEGORY_LEANBACK_SETTINGS = "android.intent.category.LEANBACK_SETTINGS";
    field public static final String EXTRA_CALLING_PACKAGE = "android.intent.extra.CALLING_PACKAGE";
    field public static final String EXTRA_FORCE_FACTORY_RESET = "android.intent.extra.FORCE_FACTORY_RESET";
    field public static final String EXTRA_INSTANT_APP_ACTION = "android.intent.extra.INSTANT_APP_ACTION";
    field public static final String EXTRA_INSTANT_APP_BUNDLES = "android.intent.extra.INSTANT_APP_BUNDLES";
    field public static final String EXTRA_INSTANT_APP_EXTRAS = "android.intent.extra.INSTANT_APP_EXTRAS";
    field public static final String EXTRA_INSTANT_APP_FAILURE = "android.intent.extra.INSTANT_APP_FAILURE";
    field public static final String EXTRA_INSTANT_APP_HOSTNAME = "android.intent.extra.INSTANT_APP_HOSTNAME";
    field public static final String EXTRA_INSTANT_APP_SUCCESS = "android.intent.extra.INSTANT_APP_SUCCESS";
    field public static final String EXTRA_INSTANT_APP_TOKEN = "android.intent.extra.INSTANT_APP_TOKEN";
    field public static final String EXTRA_LONG_VERSION_CODE = "android.intent.extra.LONG_VERSION_CODE";
    field public static final String EXTRA_ORIGINATING_UID = "android.intent.extra.ORIGINATING_UID";
    field public static final String EXTRA_PACKAGES = "android.intent.extra.PACKAGES";
    field public static final String EXTRA_PERMISSION_NAME = "android.intent.extra.PERMISSION_NAME";
    field public static final String EXTRA_REASON = "android.intent.extra.REASON";
    field public static final String EXTRA_REMOTE_CALLBACK = "android.intent.extra.REMOTE_CALLBACK";
    field public static final String EXTRA_RESULT_NEEDED = "android.intent.extra.RESULT_NEEDED";
    field public static final String EXTRA_UNKNOWN_INSTANT_APP = "android.intent.extra.UNKNOWN_INSTANT_APP";
    field public static final String EXTRA_VERIFICATION_BUNDLE = "android.intent.extra.VERIFICATION_BUNDLE";
  }

  public class IntentFilter implements android.os.Parcelable {
    method public final int getOrder();
    method public final void setOrder(int);
  }

}

package android.content.pm {

  public class ApplicationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
    method public boolean isInstantApp();
    field public String credentialProtectedDataDir;
    field public int targetSandboxVersion;
  }

  public final class InstantAppInfo implements android.os.Parcelable {
    ctor public InstantAppInfo(android.content.pm.ApplicationInfo, String[], String[]);
    ctor public InstantAppInfo(String, CharSequence, String[], String[]);
    method public int describeContents();
    method @Nullable public android.content.pm.ApplicationInfo getApplicationInfo();
    method @Nullable public String[] getGrantedPermissions();
    method @NonNull public String getPackageName();
    method @Nullable public String[] getRequestedPermissions();
    method @NonNull public android.graphics.drawable.Drawable loadIcon(@NonNull android.content.pm.PackageManager);
    method @NonNull public CharSequence loadLabel(@NonNull android.content.pm.PackageManager);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.InstantAppInfo> CREATOR;
  }

  public final class InstantAppIntentFilter implements android.os.Parcelable {
    ctor public InstantAppIntentFilter(@Nullable String, @NonNull java.util.List<android.content.IntentFilter>);
    method public int describeContents();
    method public java.util.List<android.content.IntentFilter> getFilters();
    method public String getSplitName();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.InstantAppIntentFilter> CREATOR;
  }

  public final class InstantAppResolveInfo implements android.os.Parcelable {
    ctor public InstantAppResolveInfo(@NonNull android.content.pm.InstantAppResolveInfo.InstantAppDigest, @Nullable String, @Nullable java.util.List<android.content.pm.InstantAppIntentFilter>, int);
    ctor public InstantAppResolveInfo(@NonNull android.content.pm.InstantAppResolveInfo.InstantAppDigest, @Nullable String, @Nullable java.util.List<android.content.pm.InstantAppIntentFilter>, long, @Nullable android.os.Bundle);
    ctor public InstantAppResolveInfo(@NonNull String, @Nullable String, @Nullable java.util.List<android.content.pm.InstantAppIntentFilter>);
    ctor public InstantAppResolveInfo(@Nullable android.os.Bundle);
    method public int describeContents();
    method public byte[] getDigestBytes();
    method public int getDigestPrefix();
    method @Nullable public android.os.Bundle getExtras();
    method public java.util.List<android.content.pm.InstantAppIntentFilter> getIntentFilters();
    method public long getLongVersionCode();
    method public String getPackageName();
    method @Deprecated public int getVersionCode();
    method public boolean shouldLetInstallerDecide();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.InstantAppResolveInfo> CREATOR;
  }

  public static final class InstantAppResolveInfo.InstantAppDigest implements android.os.Parcelable {
    ctor public InstantAppResolveInfo.InstantAppDigest(@NonNull String);
    method public int describeContents();
    method public byte[][] getDigestBytes();
    method public int[] getDigestPrefix();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.InstantAppResolveInfo.InstantAppDigest> CREATOR;
    field public static final android.content.pm.InstantAppResolveInfo.InstantAppDigest UNDEFINED;
  }

  public final class IntentFilterVerificationInfo implements android.os.Parcelable {
    method public int describeContents();
    method public java.util.Set<java.lang.String> getDomains();
    method public String getPackageName();
    method public int getStatus();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.IntentFilterVerificationInfo> CREATOR;
  }

  public class PackageInstaller {
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean);
  }

  public static class PackageInstaller.Session implements java.io.Closeable {
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void commitTransferred(@NonNull android.content.IntentSender);
  }

  public static class PackageInstaller.SessionInfo implements android.os.Parcelable {
    method public boolean getAllocateAggressive();
    method public boolean getAllowDowngrade();
    method public boolean getDontKillApp();
    method @Nullable public String[] getGrantedRuntimePermissions();
    method public boolean getInstallAsFullApp(boolean);
    method public boolean getInstallAsInstantApp(boolean);
    method public boolean getInstallAsVirtualPreload();
  }

  public static class PackageInstaller.SessionParams implements android.os.Parcelable {
    method @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public void setAllocateAggressive(boolean);
    method public void setAllowDowngrade(boolean);
    method public void setDontKillApp(boolean);
    method @RequiresPermission(android.Manifest.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS) public void setGrantedRuntimePermissions(String[]);
    method public void setInstallAsInstantApp(boolean);
    method public void setInstallAsVirtualPreload();
  }

  public class PackageItemInfo {
    method @NonNull public CharSequence loadSafeLabel(@NonNull android.content.pm.PackageManager);
  }

  public abstract class PackageManager {
    method @RequiresPermission("android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS") public abstract void addOnPermissionsChangeListener(android.content.pm.PackageManager.OnPermissionsChangedListener);
    method public abstract java.util.List<android.content.IntentFilter> getAllIntentFilters(String);
    method @NonNull public android.content.pm.dex.ArtManager getArtManager();
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public abstract String getDefaultBrowserPackageNameAsUser(int);
    method @Nullable @RequiresPermission(android.Manifest.permission.SET_HARMFUL_APP_WARNINGS) public CharSequence getHarmfulAppWarning(@NonNull String);
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public abstract java.util.List<android.content.pm.PackageInfo> getInstalledPackagesAsUser(int, int);
    method @Nullable @RequiresPermission("android.permission.ACCESS_INSTANT_APPS") public abstract android.graphics.drawable.Drawable getInstantAppIcon(String);
    method public abstract android.content.ComponentName getInstantAppInstallerComponent();
    method public abstract android.content.ComponentName getInstantAppResolverSettingsComponent();
    method @NonNull @RequiresPermission("android.permission.ACCESS_INSTANT_APPS") public abstract java.util.List<android.content.pm.InstantAppInfo> getInstantApps();
    method public abstract java.util.List<android.content.pm.IntentFilterVerificationInfo> getIntentFilterVerifications(String);
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public abstract int getIntentVerificationStatusAsUser(String, int);
    method @android.content.pm.PackageManager.PermissionFlags @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS}) public abstract int getPermissionFlags(String, String, @NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public abstract void grantRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
    method public abstract int installExistingPackage(String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public abstract int installExistingPackage(String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method public boolean isPackageSuspended(String) throws android.content.pm.PackageManager.NameNotFoundException;
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceiversAsUser(android.content.Intent, int, android.os.UserHandle);
    method public abstract void registerDexModule(String, @Nullable android.content.pm.PackageManager.DexModuleRegisterCallback);
    method @RequiresPermission("android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS") public abstract void removeOnPermissionsChangeListener(android.content.pm.PackageManager.OnPermissionsChangedListener);
    method @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) public abstract void revokeRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
    method @RequiresPermission(allOf={android.Manifest.permission.SET_PREFERRED_APPLICATIONS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public abstract boolean setDefaultBrowserPackageNameAsUser(String, int);
    method @RequiresPermission(android.Manifest.permission.SET_HARMFUL_APP_WARNINGS) public void setHarmfulAppWarning(@NonNull String, @Nullable CharSequence);
    method @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setPackagesSuspended(String[], boolean, @Nullable android.os.PersistableBundle, @Nullable android.os.PersistableBundle, String);
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public abstract void setUpdateAvailable(String, boolean);
    method @RequiresPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS) public abstract boolean updateIntentVerificationStatusAsUser(String, int, int);
    method @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS}) public abstract void updatePermissionFlags(String, String, @android.content.pm.PackageManager.PermissionFlags int, @android.content.pm.PackageManager.PermissionFlags int, @NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.INTENT_FILTER_VERIFICATION_AGENT) public abstract void verifyIntentFilter(int, int, java.util.List<java.lang.String>);
    field public static final String ACTION_REQUEST_PERMISSIONS = "android.content.pm.action.REQUEST_PERMISSIONS";
    field public static final String EXTRA_REQUEST_PERMISSIONS_NAMES = "android.content.pm.extra.REQUEST_PERMISSIONS_NAMES";
    field public static final String EXTRA_REQUEST_PERMISSIONS_RESULTS = "android.content.pm.extra.REQUEST_PERMISSIONS_RESULTS";
    field public static final String FEATURE_BROADCAST_RADIO = "android.hardware.broadcastradio";
    field public static final String FEATURE_TELEPHONY_CARRIERLOCK = "android.hardware.telephony.carrierlock";
    field public static final int FLAG_PERMISSION_GRANTED_BY_DEFAULT = 32; // 0x20
    field public static final int FLAG_PERMISSION_POLICY_FIXED = 4; // 0x4
    field public static final int FLAG_PERMISSION_REVIEW_REQUIRED = 64; // 0x40
    field public static final int FLAG_PERMISSION_REVOKE_ON_UPGRADE = 8; // 0x8
    field public static final int FLAG_PERMISSION_SYSTEM_FIXED = 16; // 0x10
    field public static final int FLAG_PERMISSION_USER_FIXED = 2; // 0x2
    field public static final int FLAG_PERMISSION_USER_SET = 1; // 0x1
    field public static final int INSTALL_FAILED_ALREADY_EXISTS = -1; // 0xffffffff
    field public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; // 0xfffffff3
    field public static final int INSTALL_FAILED_CONTAINER_ERROR = -18; // 0xffffffee
    field public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16; // 0xfffffff0
    field public static final int INSTALL_FAILED_DEXOPT = -11; // 0xfffffff5
    field public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5; // 0xfffffffb
    field public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4; // 0xfffffffc
    field public static final int INSTALL_FAILED_INTERNAL_ERROR = -110; // 0xffffff92
    field public static final int INSTALL_FAILED_INVALID_APK = -2; // 0xfffffffe
    field public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19; // 0xffffffed
    field public static final int INSTALL_FAILED_INVALID_URI = -3; // 0xfffffffd
    field public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20; // 0xffffffec
    field public static final int INSTALL_FAILED_MISSING_FEATURE = -17; // 0xffffffef
    field public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9; // 0xfffffff7
    field public static final int INSTALL_FAILED_NEWER_SDK = -14; // 0xfffffff2
    field public static final int INSTALL_FAILED_NO_SHARED_USER = -6; // 0xfffffffa
    field public static final int INSTALL_FAILED_OLDER_SDK = -12; // 0xfffffff4
    field public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23; // 0xffffffe9
    field public static final int INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE = -26; // 0xffffffe6
    field public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10; // 0xfffffff6
    field public static final int INSTALL_FAILED_SANDBOX_VERSION_DOWNGRADE = -27; // 0xffffffe5
    field public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8; // 0xfffffff8
    field public static final int INSTALL_FAILED_TEST_ONLY = -15; // 0xfffffff1
    field public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7; // 0xfffffff9
    field public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22; // 0xffffffea
    field public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21; // 0xffffffeb
    field public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101; // 0xffffff9b
    field public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106; // 0xffffff96
    field public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107; // 0xffffff95
    field public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105; // 0xffffff97
    field public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104; // 0xffffff98
    field public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109; // 0xffffff93
    field public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108; // 0xffffff94
    field public static final int INSTALL_PARSE_FAILED_NOT_APK = -100; // 0xffffff9c
    field public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103; // 0xffffff99
    field public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102; // 0xffffff9a
    field public static final int INSTALL_SUCCEEDED = 1; // 0x1
    field public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS = 2; // 0x2
    field public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK = 4; // 0x4
    field public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK = 1; // 0x1
    field public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER = 3; // 0x3
    field public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED = 0; // 0x0
    field public static final int INTENT_FILTER_VERIFICATION_FAILURE = -1; // 0xffffffff
    field public static final int INTENT_FILTER_VERIFICATION_SUCCESS = 1; // 0x1
    field public static final int MASK_PERMISSION_FLAGS = 255; // 0xff
    field public static final int MATCH_ANY_USER = 4194304; // 0x400000
    field public static final int MATCH_FACTORY_ONLY = 2097152; // 0x200000
    field public static final int MATCH_INSTANT = 8388608; // 0x800000
  }

  public abstract static class PackageManager.DexModuleRegisterCallback {
    ctor public PackageManager.DexModuleRegisterCallback();
    method public abstract void onDexModuleRegistered(String, boolean, String);
  }

  public static interface PackageManager.OnPermissionsChangedListener {
    method public void onPermissionsChanged(int);
  }

  @IntDef(prefix={"FLAG_PERMISSION_"}, value={android.content.pm.PackageManager.FLAG_PERMISSION_USER_SET, android.content.pm.PackageManager.FLAG_PERMISSION_USER_FIXED, android.content.pm.PackageManager.FLAG_PERMISSION_POLICY_FIXED, android.content.pm.PackageManager.FLAG_PERMISSION_REVOKE_ON_UPGRADE, android.content.pm.PackageManager.FLAG_PERMISSION_SYSTEM_FIXED, android.content.pm.PackageManager.FLAG_PERMISSION_GRANTED_BY_DEFAULT}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PackageManager.PermissionFlags {
  }

  public class PermissionGroupInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
    field @StringRes public int requestRes;
  }

  public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
    field public static final int FLAG_REMOVED = 2; // 0x2
    field public static final int PROTECTION_FLAG_OEM = 16384; // 0x4000
    field public static final int PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER = 65536; // 0x10000
    field public int requestRes;
  }

}

package android.content.pm.dex {

  public class ArtManager {
    method @RequiresPermission(allOf={android.Manifest.permission.READ_RUNTIME_PROFILES, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean isRuntimeProfilingEnabled(int);
    method @RequiresPermission(allOf={android.Manifest.permission.READ_RUNTIME_PROFILES, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void snapshotRuntimeProfile(int, @Nullable String, @Nullable String, @NonNull java.util.concurrent.Executor, @NonNull android.content.pm.dex.ArtManager.SnapshotRuntimeProfileCallback);
    field public static final int PROFILE_APPS = 0; // 0x0
    field public static final int PROFILE_BOOT_IMAGE = 1; // 0x1
    field public static final int SNAPSHOT_FAILED_CODE_PATH_NOT_FOUND = 1; // 0x1
    field public static final int SNAPSHOT_FAILED_INTERNAL_ERROR = 2; // 0x2
    field public static final int SNAPSHOT_FAILED_PACKAGE_NOT_FOUND = 0; // 0x0
  }

  public abstract static class ArtManager.SnapshotRuntimeProfileCallback {
    ctor public ArtManager.SnapshotRuntimeProfileCallback();
    method public abstract void onError(int);
    method public abstract void onSuccess(android.os.ParcelFileDescriptor);
  }

}

package android.content.pm.permission {

  public final class RuntimePermissionPresentationInfo implements android.os.Parcelable {
    ctor public RuntimePermissionPresentationInfo(CharSequence, boolean, boolean);
    method public int describeContents();
    method @NonNull public CharSequence getLabel();
    method public boolean isGranted();
    method public boolean isStandard();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.content.pm.permission.RuntimePermissionPresentationInfo> CREATOR;
  }

}

package android.hardware {

  public final class Sensor {
    method public java.util.UUID getUuid();
    method public boolean isDataInjectionSupported();
    field public static final String STRING_TYPE_DYNAMIC_SENSOR_META = "android.sensor.dynamic_sensor_meta";
    field public static final String STRING_TYPE_WRIST_TILT_GESTURE = "android.sensor.wrist_tilt_gesture";
    field public static final int TYPE_DYNAMIC_SENSOR_META = 32; // 0x20
    field public static final int TYPE_WRIST_TILT_GESTURE = 26; // 0x1a
  }

  public abstract class SensorManager {
    method public boolean initDataInjection(boolean);
    method public boolean injectSensorData(android.hardware.Sensor, float[], int, long);
  }

}

package android.hardware.camera2 {

  public abstract class CameraDevice implements java.lang.AutoCloseable {
    method public abstract void createCustomCaptureSession(android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, int, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    field public static final int SESSION_OPERATION_MODE_CONSTRAINED_HIGH_SPEED = 1; // 0x1
    field public static final int SESSION_OPERATION_MODE_NORMAL = 0; // 0x0
    field public static final int SESSION_OPERATION_MODE_VENDOR_START = 32768; // 0x8000
  }

}

package android.hardware.camera2.params {

  public final class OutputConfiguration implements android.os.Parcelable {
    ctor public OutputConfiguration(@NonNull android.view.Surface, int);
    ctor public OutputConfiguration(int, @NonNull android.view.Surface, int);
    method public int getRotation();
    field public static final int ROTATION_0 = 0; // 0x0
    field public static final int ROTATION_180 = 2; // 0x2
    field public static final int ROTATION_270 = 3; // 0x3
    field public static final int ROTATION_90 = 1; // 0x1
  }

}

package android.hardware.display {

  public final class AmbientBrightnessDayStats implements android.os.Parcelable {
    method public int describeContents();
    method public float[] getBucketBoundaries();
    method public java.time.LocalDate getLocalDate();
    method public float[] getStats();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.display.AmbientBrightnessDayStats> CREATOR;
  }

  public final class BrightnessChangeEvent implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.display.BrightnessChangeEvent> CREATOR;
    field public final float batteryLevel;
    field public final float brightness;
    field public final int colorTemperature;
    field public final boolean isDefaultBrightnessConfig;
    field public final boolean isUserSetBrightness;
    field public final float lastBrightness;
    field public final long[] luxTimestamps;
    field public final float[] luxValues;
    field public final boolean nightMode;
    field public final String packageName;
    field public final float powerBrightnessFactor;
    field public final long timeStamp;
  }

  public final class BrightnessConfiguration implements android.os.Parcelable {
    method public int describeContents();
    method public android.util.Pair<float[],float[]> getCurve();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.display.BrightnessConfiguration> CREATOR;
  }

  public static class BrightnessConfiguration.Builder {
    ctor public BrightnessConfiguration.Builder(float[], float[]);
    method public android.hardware.display.BrightnessConfiguration build();
    method public android.hardware.display.BrightnessConfiguration.Builder setDescription(@Nullable String);
  }

  public final class DisplayManager {
    method @RequiresPermission(android.Manifest.permission.ACCESS_AMBIENT_LIGHT_STATS) public java.util.List<android.hardware.display.AmbientBrightnessDayStats> getAmbientBrightnessStats();
    method @RequiresPermission(android.Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS) public android.hardware.display.BrightnessConfiguration getBrightnessConfiguration();
    method @RequiresPermission(android.Manifest.permission.BRIGHTNESS_SLIDER_USAGE) public java.util.List<android.hardware.display.BrightnessChangeEvent> getBrightnessEvents();
    method @Nullable @RequiresPermission(android.Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS) public android.hardware.display.BrightnessConfiguration getDefaultBrightnessConfiguration();
    method public android.util.Pair<float[],float[]> getMinimumBrightnessCurve();
    method public android.graphics.Point getStableDisplaySize();
    method @RequiresPermission(android.Manifest.permission.CONFIGURE_DISPLAY_BRIGHTNESS) public void setBrightnessConfiguration(android.hardware.display.BrightnessConfiguration);
    method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_SATURATION) public void setSaturationLevel(float);
  }

}

package android.hardware.hdmi {

  public abstract class HdmiClient {
    method public android.hardware.hdmi.HdmiDeviceInfo getActiveSource();
    method public void sendKeyEvent(int, boolean);
    method public void sendVendorCommand(int, byte[], boolean);
    method public void setVendorCommandListener(@NonNull android.hardware.hdmi.HdmiControlManager.VendorCommandListener);
  }

  public final class HdmiControlManager {
    method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void addHotplugEventListener(android.hardware.hdmi.HdmiControlManager.HotplugEventListener);
    method @Nullable public android.hardware.hdmi.HdmiClient getClient(int);
    method @Nullable public android.hardware.hdmi.HdmiPlaybackClient getPlaybackClient();
    method @Nullable public android.hardware.hdmi.HdmiTvClient getTvClient();
    method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void removeHotplugEventListener(android.hardware.hdmi.HdmiControlManager.HotplugEventListener);
    method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void setStandbyMode(boolean);
    field public static final String ACTION_OSD_MESSAGE = "android.hardware.hdmi.action.OSD_MESSAGE";
    field public static final int AVR_VOLUME_MUTED = 101; // 0x65
    field public static final int CLEAR_TIMER_STATUS_CEC_DISABLE = 162; // 0xa2
    field public static final int CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION = 160; // 0xa0
    field public static final int CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE = 161; // 0xa1
    field public static final int CLEAR_TIMER_STATUS_TIMER_CLEARED = 128; // 0x80
    field public static final int CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_NO_INFO_AVAILABLE = 2; // 0x2
    field public static final int CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_NO_MATCHING = 1; // 0x1
    field public static final int CLEAR_TIMER_STATUS_TIMER_NOT_CLEARED_RECORDING = 0; // 0x0
    field public static final int CONTROL_STATE_CHANGED_REASON_SETTING = 1; // 0x1
    field public static final int CONTROL_STATE_CHANGED_REASON_STANDBY = 3; // 0x3
    field public static final int CONTROL_STATE_CHANGED_REASON_START = 0; // 0x0
    field public static final int CONTROL_STATE_CHANGED_REASON_WAKEUP = 2; // 0x2
    field public static final int DEVICE_EVENT_ADD_DEVICE = 1; // 0x1
    field public static final int DEVICE_EVENT_REMOVE_DEVICE = 2; // 0x2
    field public static final int DEVICE_EVENT_UPDATE_DEVICE = 3; // 0x3
    field public static final String EXTRA_MESSAGE_EXTRA_PARAM1 = "android.hardware.hdmi.extra.MESSAGE_EXTRA_PARAM1";
    field public static final String EXTRA_MESSAGE_ID = "android.hardware.hdmi.extra.MESSAGE_ID";
    field public static final int ONE_TOUCH_RECORD_ALREADY_RECORDING = 18; // 0x12
    field public static final int ONE_TOUCH_RECORD_CEC_DISABLED = 51; // 0x33
    field public static final int ONE_TOUCH_RECORD_CHECK_RECORDER_CONNECTION = 49; // 0x31
    field public static final int ONE_TOUCH_RECORD_DISALLOW_TO_COPY = 13; // 0xd
    field public static final int ONE_TOUCH_RECORD_DISALLOW_TO_FUTHER_COPIES = 14; // 0xe
    field public static final int ONE_TOUCH_RECORD_FAIL_TO_RECORD_DISPLAYED_SCREEN = 50; // 0x32
    field public static final int ONE_TOUCH_RECORD_INVALID_EXTERNAL_PHYSICAL_ADDRESS = 10; // 0xa
    field public static final int ONE_TOUCH_RECORD_INVALID_EXTERNAL_PLUG_NUMBER = 9; // 0x9
    field public static final int ONE_TOUCH_RECORD_MEDIA_PROBLEM = 21; // 0x15
    field public static final int ONE_TOUCH_RECORD_MEDIA_PROTECTED = 19; // 0x13
    field public static final int ONE_TOUCH_RECORD_NOT_ENOUGH_SPACE = 22; // 0x16
    field public static final int ONE_TOUCH_RECORD_NO_MEDIA = 16; // 0x10
    field public static final int ONE_TOUCH_RECORD_NO_OR_INSUFFICIENT_CA_ENTITLEMENTS = 12; // 0xc
    field public static final int ONE_TOUCH_RECORD_NO_SOURCE_SIGNAL = 20; // 0x14
    field public static final int ONE_TOUCH_RECORD_OTHER_REASON = 31; // 0x1f
    field public static final int ONE_TOUCH_RECORD_PARENT_LOCK_ON = 23; // 0x17
    field public static final int ONE_TOUCH_RECORD_PLAYING = 17; // 0x11
    field public static final int ONE_TOUCH_RECORD_PREVIOUS_RECORDING_IN_PROGRESS = 48; // 0x30
    field public static final int ONE_TOUCH_RECORD_RECORDING_ALREADY_TERMINATED = 27; // 0x1b
    field public static final int ONE_TOUCH_RECORD_RECORDING_ANALOGUE_SERVICE = 3; // 0x3
    field public static final int ONE_TOUCH_RECORD_RECORDING_CURRENTLY_SELECTED_SOURCE = 1; // 0x1
    field public static final int ONE_TOUCH_RECORD_RECORDING_DIGITAL_SERVICE = 2; // 0x2
    field public static final int ONE_TOUCH_RECORD_RECORDING_EXTERNAL_INPUT = 4; // 0x4
    field public static final int ONE_TOUCH_RECORD_RECORDING_TERMINATED_NORMALLY = 26; // 0x1a
    field public static final int ONE_TOUCH_RECORD_UNABLE_ANALOGUE_SERVICE = 6; // 0x6
    field public static final int ONE_TOUCH_RECORD_UNABLE_DIGITAL_SERVICE = 5; // 0x5
    field public static final int ONE_TOUCH_RECORD_UNABLE_SELECTED_SERVICE = 7; // 0x7
    field public static final int ONE_TOUCH_RECORD_UNSUPPORTED_CA = 11; // 0xb
    field public static final int OSD_MESSAGE_ARC_CONNECTED_INVALID_PORT = 1; // 0x1
    field public static final int OSD_MESSAGE_AVR_VOLUME_CHANGED = 2; // 0x2
    field public static final int POWER_STATUS_ON = 0; // 0x0
    field public static final int POWER_STATUS_STANDBY = 1; // 0x1
    field public static final int POWER_STATUS_TRANSIENT_TO_ON = 2; // 0x2
    field public static final int POWER_STATUS_TRANSIENT_TO_STANDBY = 3; // 0x3
    field public static final int POWER_STATUS_UNKNOWN = -1; // 0xffffffff
    field @Deprecated public static final int RESULT_ALREADY_IN_PROGRESS = 4; // 0x4
    field public static final int RESULT_COMMUNICATION_FAILED = 7; // 0x7
    field public static final int RESULT_EXCEPTION = 5; // 0x5
    field public static final int RESULT_INCORRECT_MODE = 6; // 0x6
    field public static final int RESULT_SOURCE_NOT_AVAILABLE = 2; // 0x2
    field public static final int RESULT_SUCCESS = 0; // 0x0
    field public static final int RESULT_TARGET_NOT_AVAILABLE = 3; // 0x3
    field public static final int RESULT_TIMEOUT = 1; // 0x1
    field public static final int TIMER_RECORDING_RESULT_EXTRA_CEC_DISABLED = 3; // 0x3
    field public static final int TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION = 1; // 0x1
    field public static final int TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE = 2; // 0x2
    field public static final int TIMER_RECORDING_RESULT_EXTRA_NO_ERROR = 0; // 0x0
    field public static final int TIMER_RECORDING_TYPE_ANALOGUE = 2; // 0x2
    field public static final int TIMER_RECORDING_TYPE_DIGITAL = 1; // 0x1
    field public static final int TIMER_RECORDING_TYPE_EXTERNAL = 3; // 0x3
    field public static final int TIMER_STATUS_MEDIA_INFO_NOT_PRESENT = 2; // 0x2
    field public static final int TIMER_STATUS_MEDIA_INFO_PRESENT_NOT_PROTECTED = 0; // 0x0
    field public static final int TIMER_STATUS_MEDIA_INFO_PRESENT_PROTECTED = 1; // 0x1
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_CA_NOT_SUPPORTED = 6; // 0x6
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_CLOCK_FAILURE = 10; // 0xa
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_DATE_OUT_OF_RANGE = 2; // 0x2
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_DUPLICATED = 14; // 0xe
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_INVALID_EXTERNAL_PHYSICAL_NUMBER = 5; // 0x5
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_INVALID_EXTERNAL_PLUG_NUMBER = 4; // 0x4
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_INVALID_SEQUENCE = 3; // 0x3
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_NO_CA_ENTITLEMENTS = 7; // 0x7
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_NO_FREE_TIME = 1; // 0x1
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_PARENTAL_LOCK_ON = 9; // 0x9
    field public static final int TIMER_STATUS_NOT_PROGRAMMED_UNSUPPORTED_RESOLUTION = 8; // 0x8
    field public static final int TIMER_STATUS_PROGRAMMED_INFO_ENOUGH_SPACE = 8; // 0x8
    field public static final int TIMER_STATUS_PROGRAMMED_INFO_MIGHT_NOT_ENOUGH_SPACE = 11; // 0xb
    field public static final int TIMER_STATUS_PROGRAMMED_INFO_NOT_ENOUGH_SPACE = 9; // 0x9
    field public static final int TIMER_STATUS_PROGRAMMED_INFO_NO_MEDIA_INFO = 10; // 0xa
  }

  public static interface HdmiControlManager.HotplugEventListener {
    method public void onReceived(android.hardware.hdmi.HdmiHotplugEvent);
  }

  public static interface HdmiControlManager.VendorCommandListener {
    method public void onControlStateChanged(boolean, int);
    method public void onReceived(int, int, byte[], boolean);
  }

  public class HdmiDeviceInfo implements android.os.Parcelable {
    ctor public HdmiDeviceInfo();
    method public int describeContents();
    method public int getAdopterId();
    method public int getDeviceId();
    method public int getDevicePowerStatus();
    method public int getDeviceType();
    method public String getDisplayName();
    method public int getId();
    method public int getLogicalAddress();
    method public int getPhysicalAddress();
    method public int getPortId();
    method public int getVendorId();
    method public static int idForCecDevice(int);
    method public static int idForHardware(int);
    method public static int idForMhlDevice(int);
    method public boolean isCecDevice();
    method public boolean isInactivated();
    method public boolean isMhlDevice();
    method public boolean isSourceType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ADDR_INTERNAL = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.hardware.hdmi.HdmiDeviceInfo> CREATOR;
    field public static final int DEVICE_AUDIO_SYSTEM = 5; // 0x5
    field public static final int DEVICE_INACTIVE = -1; // 0xffffffff
    field public static final int DEVICE_PLAYBACK = 4; // 0x4
    field public static final int DEVICE_RECORDER = 1; // 0x1
    field public static final int DEVICE_RESERVED = 2; // 0x2
    field public static final int DEVICE_TUNER = 3; // 0x3
    field public static final int DEVICE_TV = 0; // 0x0
    field public static final int ID_INVALID = 65535; // 0xffff
    field public static final android.hardware.hdmi.HdmiDeviceInfo INACTIVE_DEVICE;
    field public static final int PATH_INTERNAL = 0; // 0x0
    field public static final int PATH_INVALID = 65535; // 0xffff
    field public static final int PORT_INVALID = -1; // 0xffffffff
  }

  public final class HdmiHotplugEvent implements android.os.Parcelable {
    method public int describeContents();
    method public int getPort();
    method public boolean isConnected();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.hdmi.HdmiHotplugEvent> CREATOR;
  }

  public final class HdmiPlaybackClient extends android.hardware.hdmi.HdmiClient {
    method public int getDeviceType();
    method public void oneTouchPlay(android.hardware.hdmi.HdmiPlaybackClient.OneTouchPlayCallback);
    method public void queryDisplayStatus(android.hardware.hdmi.HdmiPlaybackClient.DisplayStatusCallback);
    method public void sendStandby();
  }

  public static interface HdmiPlaybackClient.DisplayStatusCallback {
    method public void onComplete(int);
  }

  public static interface HdmiPlaybackClient.OneTouchPlayCallback {
    method public void onComplete(int);
  }

  public final class HdmiPortInfo implements android.os.Parcelable {
    ctor public HdmiPortInfo(int, int, int, boolean, boolean, boolean);
    method public int describeContents();
    method public int getAddress();
    method public int getId();
    method public int getType();
    method public boolean isArcSupported();
    method public boolean isCecSupported();
    method public boolean isMhlSupported();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.hdmi.HdmiPortInfo> CREATOR;
    field public static final int PORT_INPUT = 0; // 0x0
    field public static final int PORT_OUTPUT = 1; // 0x1
  }

  public abstract class HdmiRecordListener {
    ctor public HdmiRecordListener();
    method public void onClearTimerRecordingResult(int, int);
    method public void onOneTouchRecordResult(int, int);
    method public abstract android.hardware.hdmi.HdmiRecordSources.RecordSource onOneTouchRecordSourceRequested(int);
    method public void onTimerRecordingResult(int, android.hardware.hdmi.HdmiRecordListener.TimerStatusData);
  }

  public static class HdmiRecordListener.TimerStatusData {
    method public int getDurationHour();
    method public int getDurationMinute();
    method public int getExtraError();
    method public int getMediaInfo();
    method public int getNotProgammedError();
    method public int getProgrammedInfo();
    method public boolean isOverlapped();
    method public boolean isProgrammed();
  }

  public final class HdmiRecordSources {
    method public static boolean checkRecordSource(byte[]);
    method public static android.hardware.hdmi.HdmiRecordSources.OwnSource ofOwnSource();
  }

  public static final class HdmiRecordSources.AnalogueServiceSource extends android.hardware.hdmi.HdmiRecordSources.RecordSource {
  }

  public static final class HdmiRecordSources.DigitalServiceSource extends android.hardware.hdmi.HdmiRecordSources.RecordSource {
  }

  public static final class HdmiRecordSources.ExternalPhysicalAddress extends android.hardware.hdmi.HdmiRecordSources.RecordSource {
  }

  public static final class HdmiRecordSources.ExternalPlugData extends android.hardware.hdmi.HdmiRecordSources.RecordSource {
  }

  public static final class HdmiRecordSources.OwnSource extends android.hardware.hdmi.HdmiRecordSources.RecordSource {
  }

  public abstract static class HdmiRecordSources.RecordSource {
  }

  public class HdmiTimerRecordSources {
    method public static boolean checkTimerRecordSource(int, byte[]);
    method public static android.hardware.hdmi.HdmiTimerRecordSources.Duration durationOf(int, int);
    method public static android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource ofAnalogueSource(android.hardware.hdmi.HdmiTimerRecordSources.TimerInfo, android.hardware.hdmi.HdmiRecordSources.AnalogueServiceSource);
    method public static android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource ofDigitalSource(android.hardware.hdmi.HdmiTimerRecordSources.TimerInfo, android.hardware.hdmi.HdmiRecordSources.DigitalServiceSource);
    method public static android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource ofExternalPhysicalAddress(android.hardware.hdmi.HdmiTimerRecordSources.TimerInfo, android.hardware.hdmi.HdmiRecordSources.ExternalPhysicalAddress);
    method public static android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource ofExternalPlug(android.hardware.hdmi.HdmiTimerRecordSources.TimerInfo, android.hardware.hdmi.HdmiRecordSources.ExternalPlugData);
    method public static android.hardware.hdmi.HdmiTimerRecordSources.Time timeOf(int, int);
    method public static android.hardware.hdmi.HdmiTimerRecordSources.TimerInfo timerInfoOf(int, int, android.hardware.hdmi.HdmiTimerRecordSources.Time, android.hardware.hdmi.HdmiTimerRecordSources.Duration, int);
    field public static final int RECORDING_SEQUENCE_REPEAT_FRIDAY = 32; // 0x20
    field public static final int RECORDING_SEQUENCE_REPEAT_MONDAY = 2; // 0x2
    field public static final int RECORDING_SEQUENCE_REPEAT_ONCE_ONLY = 0; // 0x0
    field public static final int RECORDING_SEQUENCE_REPEAT_SATUREDAY = 64; // 0x40
    field public static final int RECORDING_SEQUENCE_REPEAT_SUNDAY = 1; // 0x1
    field public static final int RECORDING_SEQUENCE_REPEAT_THURSDAY = 16; // 0x10
    field public static final int RECORDING_SEQUENCE_REPEAT_TUESDAY = 4; // 0x4
    field public static final int RECORDING_SEQUENCE_REPEAT_WEDNESDAY = 8; // 0x8
  }

  public static final class HdmiTimerRecordSources.Duration {
  }

  public static final class HdmiTimerRecordSources.Time {
  }

  public static final class HdmiTimerRecordSources.TimerInfo {
  }

  public static final class HdmiTimerRecordSources.TimerRecordSource {
  }

  public final class HdmiTvClient extends android.hardware.hdmi.HdmiClient {
    method public void clearTimerRecording(int, int, android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource);
    method public void deviceSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback);
    method public java.util.List<android.hardware.hdmi.HdmiDeviceInfo> getDeviceList();
    method public int getDeviceType();
    method public void portSelect(int, @NonNull android.hardware.hdmi.HdmiTvClient.SelectCallback);
    method public void sendMhlVendorCommand(int, int, int, byte[]);
    method public void sendStandby(int);
    method public void setHdmiMhlVendorCommandListener(android.hardware.hdmi.HdmiTvClient.HdmiMhlVendorCommandListener);
    method public void setInputChangeListener(android.hardware.hdmi.HdmiTvClient.InputChangeListener);
    method public void setRecordListener(@NonNull android.hardware.hdmi.HdmiRecordListener);
    method public void setSystemAudioMode(boolean, android.hardware.hdmi.HdmiTvClient.SelectCallback);
    method public void setSystemAudioMute(boolean);
    method public void setSystemAudioVolume(int, int, int);
    method public void startOneTouchRecord(int, @NonNull android.hardware.hdmi.HdmiRecordSources.RecordSource);
    method public void startTimerRecording(int, int, android.hardware.hdmi.HdmiTimerRecordSources.TimerRecordSource);
    method public void stopOneTouchRecord(int);
    field public static final int VENDOR_DATA_SIZE = 16; // 0x10
  }

  public static interface HdmiTvClient.HdmiMhlVendorCommandListener {
    method public void onReceived(int, int, int, byte[]);
  }

  public static interface HdmiTvClient.InputChangeListener {
    method public void onChanged(android.hardware.hdmi.HdmiDeviceInfo);
  }

  public static interface HdmiTvClient.SelectCallback {
    method public void onComplete(int);
  }

}

package android.hardware.location {

  public class ContextHubClient implements java.io.Closeable {
    method public void close();
    method @NonNull public android.hardware.location.ContextHubInfo getAttachedHub();
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int sendMessageToNanoApp(@NonNull android.hardware.location.NanoAppMessage);
  }

  public class ContextHubClientCallback {
    ctor public ContextHubClientCallback();
    method public void onHubReset(android.hardware.location.ContextHubClient);
    method public void onMessageFromNanoApp(android.hardware.location.ContextHubClient, android.hardware.location.NanoAppMessage);
    method public void onNanoAppAborted(android.hardware.location.ContextHubClient, long, int);
    method public void onNanoAppDisabled(android.hardware.location.ContextHubClient, long);
    method public void onNanoAppEnabled(android.hardware.location.ContextHubClient, long);
    method public void onNanoAppLoaded(android.hardware.location.ContextHubClient, long);
    method public void onNanoAppUnloaded(android.hardware.location.ContextHubClient, long);
  }

  public class ContextHubInfo implements android.os.Parcelable {
    ctor public ContextHubInfo();
    method public int describeContents();
    method public byte getChreApiMajorVersion();
    method public byte getChreApiMinorVersion();
    method public short getChrePatchVersion();
    method public long getChrePlatformId();
    method public int getId();
    method public int getMaxPacketLengthBytes();
    method public android.hardware.location.MemoryRegion[] getMemoryRegions();
    method public String getName();
    method public float getPeakMips();
    method public float getPeakPowerDrawMw();
    method public int getPlatformVersion();
    method public float getSleepPowerDrawMw();
    method public int getStaticSwVersion();
    method public float getStoppedPowerDrawMw();
    method public int[] getSupportedSensors();
    method public String getToolchain();
    method public int getToolchainVersion();
    method public String getVendor();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.location.ContextHubInfo> CREATOR;
  }

  public final class ContextHubManager {
    method @NonNull public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.ContextHubClientCallback, @NonNull java.util.concurrent.Executor);
    method @NonNull public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.ContextHubClientCallback);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) @NonNull public android.hardware.location.ContextHubTransaction<java.lang.Void> disableNanoApp(@NonNull android.hardware.location.ContextHubInfo, long);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) @NonNull public android.hardware.location.ContextHubTransaction<java.lang.Void> enableNanoApp(@NonNull android.hardware.location.ContextHubInfo, long);
    method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int[] findNanoAppOnHub(int, @NonNull android.hardware.location.NanoAppFilter);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int[] getContextHubHandles();
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.ContextHubInfo getContextHubInfo(int);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) @NonNull public java.util.List<android.hardware.location.ContextHubInfo> getContextHubs();
    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.NanoAppInstanceInfo getNanoAppInstanceInfo(int);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int loadNanoApp(int, @NonNull android.hardware.location.NanoApp);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) @NonNull public android.hardware.location.ContextHubTransaction<java.lang.Void> loadNanoApp(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.NanoAppBinary);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) @NonNull public android.hardware.location.ContextHubTransaction<java.util.List<android.hardware.location.NanoAppState>> queryNanoApps(@NonNull android.hardware.location.ContextHubInfo);
    method @Deprecated public int registerCallback(@NonNull android.hardware.location.ContextHubManager.Callback);
    method @Deprecated public int registerCallback(android.hardware.location.ContextHubManager.Callback, android.os.Handler);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int sendMessage(int, int, @NonNull android.hardware.location.ContextHubMessage);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int unloadNanoApp(int);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) @NonNull public android.hardware.location.ContextHubTransaction<java.lang.Void> unloadNanoApp(@NonNull android.hardware.location.ContextHubInfo, long);
    method @Deprecated public int unregisterCallback(@NonNull android.hardware.location.ContextHubManager.Callback);
  }

  @Deprecated public abstract static class ContextHubManager.Callback {
    ctor @Deprecated protected ContextHubManager.Callback();
    method @Deprecated public abstract void onMessageReceipt(int, int, @NonNull android.hardware.location.ContextHubMessage);
  }

  @Deprecated public class ContextHubMessage implements android.os.Parcelable {
    ctor @Deprecated public ContextHubMessage(int, int, byte[]);
    method @Deprecated public int describeContents();
    method @Deprecated public byte[] getData();
    method @Deprecated public int getMsgType();
    method @Deprecated public int getVersion();
    method @Deprecated public void setMsgData(byte[]);
    method @Deprecated public void setMsgType(int);
    method @Deprecated public void setVersion(int);
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final android.os.Parcelable.Creator<android.hardware.location.ContextHubMessage> CREATOR;
  }

  public class ContextHubTransaction<T> {
    method public int getType();
    method public void setOnCompleteListener(@NonNull android.hardware.location.ContextHubTransaction.OnCompleteListener<T>, @NonNull java.util.concurrent.Executor);
    method public void setOnCompleteListener(@NonNull android.hardware.location.ContextHubTransaction.OnCompleteListener<T>);
    method public static String typeToString(int, boolean);
    method public android.hardware.location.ContextHubTransaction.Response<T> waitForResponse(long, java.util.concurrent.TimeUnit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException;
    field public static final int RESULT_FAILED_AT_HUB = 5; // 0x5
    field public static final int RESULT_FAILED_BAD_PARAMS = 2; // 0x2
    field public static final int RESULT_FAILED_BUSY = 4; // 0x4
    field public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; // 0x8
    field public static final int RESULT_FAILED_SERVICE_INTERNAL_FAILURE = 7; // 0x7
    field public static final int RESULT_FAILED_TIMEOUT = 6; // 0x6
    field public static final int RESULT_FAILED_UNINITIALIZED = 3; // 0x3
    field public static final int RESULT_FAILED_UNKNOWN = 1; // 0x1
    field public static final int RESULT_SUCCESS = 0; // 0x0
    field public static final int TYPE_DISABLE_NANOAPP = 3; // 0x3
    field public static final int TYPE_ENABLE_NANOAPP = 2; // 0x2
    field public static final int TYPE_LOAD_NANOAPP = 0; // 0x0
    field public static final int TYPE_QUERY_NANOAPPS = 4; // 0x4
    field public static final int TYPE_UNLOAD_NANOAPP = 1; // 0x1
  }

  @java.lang.FunctionalInterface public static interface ContextHubTransaction.OnCompleteListener<L> {
    method public void onComplete(android.hardware.location.ContextHubTransaction<L>, android.hardware.location.ContextHubTransaction.Response<L>);
  }

  public static class ContextHubTransaction.Response<R> {
    method public R getContents();
    method public int getResult();
  }

  public final class GeofenceHardware {
    method public boolean addGeofence(int, int, android.hardware.location.GeofenceHardwareRequest, android.hardware.location.GeofenceHardwareCallback);
    method public int[] getMonitoringTypes();
    method public int getStatusOfMonitoringType(int);
    method public boolean pauseGeofence(int, int);
    method public boolean registerForMonitorStateChangeCallback(int, android.hardware.location.GeofenceHardwareMonitorCallback);
    method public boolean removeGeofence(int, int);
    method public boolean resumeGeofence(int, int, int);
    method public boolean unregisterForMonitorStateChangeCallback(int, android.hardware.location.GeofenceHardwareMonitorCallback);
    field public static final int GEOFENCE_ENTERED = 1; // 0x1
    field public static final int GEOFENCE_ERROR_ID_EXISTS = 2; // 0x2
    field public static final int GEOFENCE_ERROR_ID_UNKNOWN = 3; // 0x3
    field public static final int GEOFENCE_ERROR_INSUFFICIENT_MEMORY = 6; // 0x6
    field public static final int GEOFENCE_ERROR_INVALID_TRANSITION = 4; // 0x4
    field public static final int GEOFENCE_ERROR_TOO_MANY_GEOFENCES = 1; // 0x1
    field public static final int GEOFENCE_EXITED = 2; // 0x2
    field public static final int GEOFENCE_FAILURE = 5; // 0x5
    field public static final int GEOFENCE_SUCCESS = 0; // 0x0
    field public static final int GEOFENCE_UNCERTAIN = 4; // 0x4
    field public static final int MONITORING_TYPE_FUSED_HARDWARE = 1; // 0x1
    field public static final int MONITORING_TYPE_GPS_HARDWARE = 0; // 0x0
    field public static final int MONITOR_CURRENTLY_AVAILABLE = 0; // 0x0
    field public static final int MONITOR_CURRENTLY_UNAVAILABLE = 1; // 0x1
    field public static final int MONITOR_UNSUPPORTED = 2; // 0x2
    field public static final int SOURCE_TECHNOLOGY_BLUETOOTH = 16; // 0x10
    field public static final int SOURCE_TECHNOLOGY_CELL = 8; // 0x8
    field public static final int SOURCE_TECHNOLOGY_GNSS = 1; // 0x1
    field public static final int SOURCE_TECHNOLOGY_SENSORS = 4; // 0x4
    field public static final int SOURCE_TECHNOLOGY_WIFI = 2; // 0x2
  }

  public abstract class GeofenceHardwareCallback {
    ctor public GeofenceHardwareCallback();
    method public void onGeofenceAdd(int, int);
    method public void onGeofencePause(int, int);
    method public void onGeofenceRemove(int, int);
    method public void onGeofenceResume(int, int);
    method public void onGeofenceTransition(int, int, android.location.Location, long, int);
  }

  public abstract class GeofenceHardwareMonitorCallback {
    ctor public GeofenceHardwareMonitorCallback();
    method @Deprecated public void onMonitoringSystemChange(int, boolean, android.location.Location);
    method public void onMonitoringSystemChange(android.hardware.location.GeofenceHardwareMonitorEvent);
  }

  public class GeofenceHardwareMonitorEvent implements android.os.Parcelable {
    ctor public GeofenceHardwareMonitorEvent(int, int, int, android.location.Location);
    method public int describeContents();
    method public android.location.Location getLocation();
    method public int getMonitoringStatus();
    method public int getMonitoringType();
    method public int getSourceTechnologies();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.location.GeofenceHardwareMonitorEvent> CREATOR;
  }

  public final class GeofenceHardwareRequest {
    ctor public GeofenceHardwareRequest();
    method public static android.hardware.location.GeofenceHardwareRequest createCircularGeofence(double, double, double);
    method public int getLastTransition();
    method public double getLatitude();
    method public double getLongitude();
    method public int getMonitorTransitions();
    method public int getNotificationResponsiveness();
    method public double getRadius();
    method public int getSourceTechnologies();
    method public int getUnknownTimer();
    method public void setLastTransition(int);
    method public void setMonitorTransitions(int);
    method public void setNotificationResponsiveness(int);
    method public void setSourceTechnologies(int);
    method public void setUnknownTimer(int);
  }

  public class MemoryRegion implements android.os.Parcelable {
    ctor public MemoryRegion(android.os.Parcel);
    method public int describeContents();
    method public int getCapacityBytes();
    method public int getFreeCapacityBytes();
    method public boolean isExecutable();
    method public boolean isReadable();
    method public boolean isWritable();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.location.MemoryRegion> CREATOR;
  }

  @Deprecated public class NanoApp implements android.os.Parcelable {
    ctor @Deprecated public NanoApp();
    ctor @Deprecated public NanoApp(int, byte[]);
    ctor @Deprecated public NanoApp(long, byte[]);
    method @Deprecated public int describeContents();
    method @Deprecated public byte[] getAppBinary();
    method @Deprecated public long getAppId();
    method @Deprecated public int getAppVersion();
    method @Deprecated public String getName();
    method @Deprecated public int getNeededExecMemBytes();
    method @Deprecated public int getNeededReadMemBytes();
    method @Deprecated public int[] getNeededSensors();
    method @Deprecated public int getNeededWriteMemBytes();
    method @Deprecated public int[] getOutputEvents();
    method @Deprecated public String getPublisher();
    method @Deprecated public void setAppBinary(byte[]);
    method @Deprecated public void setAppId(long);
    method @Deprecated public void setAppVersion(int);
    method @Deprecated public void setName(String);
    method @Deprecated public void setNeededExecMemBytes(int);
    method @Deprecated public void setNeededReadMemBytes(int);
    method @Deprecated public void setNeededSensors(int[]);
    method @Deprecated public void setNeededWriteMemBytes(int);
    method @Deprecated public void setOutputEvents(int[]);
    method @Deprecated public void setPublisher(String);
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final android.os.Parcelable.Creator<android.hardware.location.NanoApp> CREATOR;
  }

  public final class NanoAppBinary implements android.os.Parcelable {
    ctor public NanoAppBinary(byte[]);
    method public int describeContents();
    method public byte[] getBinary();
    method public byte[] getBinaryNoHeader();
    method public int getFlags();
    method public int getHeaderVersion();
    method public long getHwHubType();
    method public long getNanoAppId();
    method public int getNanoAppVersion();
    method public byte getTargetChreApiMajorVersion();
    method public byte getTargetChreApiMinorVersion();
    method public boolean hasValidHeader();
    method public boolean isEncrypted();
    method public boolean isSigned();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppBinary> CREATOR;
  }

  @Deprecated public class NanoAppFilter implements android.os.Parcelable {
    ctor @Deprecated public NanoAppFilter(long, int, int, long);
    method @Deprecated public int describeContents();
    method @Deprecated public boolean testMatch(android.hardware.location.NanoAppInstanceInfo);
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final int APP_ANY = -1; // 0xffffffff
    field @Deprecated public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppFilter> CREATOR;
    field @Deprecated public static final int FLAGS_VERSION_ANY = -1; // 0xffffffff
    field @Deprecated public static final int FLAGS_VERSION_GREAT_THAN = 2; // 0x2
    field @Deprecated public static final int FLAGS_VERSION_LESS_THAN = 4; // 0x4
    field @Deprecated public static final int FLAGS_VERSION_STRICTLY_EQUAL = 8; // 0x8
    field @Deprecated public static final int HUB_ANY = -1; // 0xffffffff
    field @Deprecated public static final int VENDOR_ANY = -1; // 0xffffffff
  }

  @Deprecated public class NanoAppInstanceInfo implements android.os.Parcelable {
    ctor @Deprecated public NanoAppInstanceInfo();
    method @Deprecated public int describeContents();
    method @Deprecated public long getAppId();
    method @Deprecated public int getAppVersion();
    method @Deprecated public int getContexthubId();
    method @Deprecated public int getHandle();
    method @Deprecated public String getName();
    method @Deprecated public int getNeededExecMemBytes();
    method @Deprecated public int getNeededReadMemBytes();
    method @Deprecated @NonNull public int[] getNeededSensors();
    method @Deprecated public int getNeededWriteMemBytes();
    method @Deprecated @NonNull public int[] getOutputEvents();
    method @Deprecated public String getPublisher();
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppInstanceInfo> CREATOR;
  }

  public final class NanoAppMessage implements android.os.Parcelable {
    method public static android.hardware.location.NanoAppMessage createMessageFromNanoApp(long, int, byte[], boolean);
    method public static android.hardware.location.NanoAppMessage createMessageToNanoApp(long, int, byte[]);
    method public int describeContents();
    method public byte[] getMessageBody();
    method public int getMessageType();
    method public long getNanoAppId();
    method public boolean isBroadcastMessage();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppMessage> CREATOR;
  }

  public final class NanoAppState implements android.os.Parcelable {
    ctor public NanoAppState(long, int, boolean);
    method public int describeContents();
    method public long getNanoAppId();
    method public long getNanoAppVersion();
    method public boolean isEnabled();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.location.NanoAppState> CREATOR;
  }

}

package android.hardware.radio {

  public final class Announcement implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.hardware.radio.ProgramSelector getSelector();
    method public int getType();
    method @NonNull public java.util.Map<java.lang.String,java.lang.String> getVendorInfo();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.radio.Announcement> CREATOR;
    field public static final int TYPE_EMERGENCY = 1; // 0x1
    field public static final int TYPE_EVENT = 6; // 0x6
    field public static final int TYPE_MISC = 8; // 0x8
    field public static final int TYPE_NEWS = 5; // 0x5
    field public static final int TYPE_SPORT = 7; // 0x7
    field public static final int TYPE_TRAFFIC = 3; // 0x3
    field public static final int TYPE_WARNING = 2; // 0x2
    field public static final int TYPE_WEATHER = 4; // 0x4
  }

  public static interface Announcement.OnListUpdatedListener {
    method public void onListUpdated(java.util.Collection<android.hardware.radio.Announcement>);
  }

  public final class ProgramList implements java.lang.AutoCloseable {
    method public void addOnCompleteListener(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.radio.ProgramList.OnCompleteListener);
    method public void addOnCompleteListener(@NonNull android.hardware.radio.ProgramList.OnCompleteListener);
    method public void close();
    method @Nullable public android.hardware.radio.RadioManager.ProgramInfo get(@NonNull android.hardware.radio.ProgramSelector.Identifier);
    method public void registerListCallback(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.radio.ProgramList.ListCallback);
    method public void registerListCallback(@NonNull android.hardware.radio.ProgramList.ListCallback);
    method public void removeOnCompleteListener(@NonNull android.hardware.radio.ProgramList.OnCompleteListener);
    method @NonNull public java.util.List<android.hardware.radio.RadioManager.ProgramInfo> toList();
    method public void unregisterListCallback(@NonNull android.hardware.radio.ProgramList.ListCallback);
  }

  public static final class ProgramList.Filter implements android.os.Parcelable {
    ctor public ProgramList.Filter(@NonNull java.util.Set<java.lang.Integer>, @NonNull java.util.Set<android.hardware.radio.ProgramSelector.Identifier>, boolean, boolean);
    method public boolean areCategoriesIncluded();
    method public boolean areModificationsExcluded();
    method public int describeContents();
    method @NonNull public java.util.Set<java.lang.Integer> getIdentifierTypes();
    method @NonNull public java.util.Set<android.hardware.radio.ProgramSelector.Identifier> getIdentifiers();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.radio.ProgramList.Filter> CREATOR;
  }

  public abstract static class ProgramList.ListCallback {
    ctor public ProgramList.ListCallback();
    method public void onItemChanged(@NonNull android.hardware.radio.ProgramSelector.Identifier);
    method public void onItemRemoved(@NonNull android.hardware.radio.ProgramSelector.Identifier);
  }

  public static interface ProgramList.OnCompleteListener {
    method public void onComplete();
  }

  public final class ProgramSelector implements android.os.Parcelable {
    ctor public ProgramSelector(@android.hardware.radio.ProgramSelector.ProgramType int, @NonNull android.hardware.radio.ProgramSelector.Identifier, @Nullable android.hardware.radio.ProgramSelector.Identifier[], @Nullable long[]);
    method @NonNull public static android.hardware.radio.ProgramSelector createAmFmSelector(@android.hardware.radio.RadioManager.Band int, int);
    method @NonNull public static android.hardware.radio.ProgramSelector createAmFmSelector(@android.hardware.radio.RadioManager.Band int, int, int);
    method public int describeContents();
    method @NonNull public android.hardware.radio.ProgramSelector.Identifier[] getAllIds(@android.hardware.radio.ProgramSelector.IdentifierType int);
    method public long getFirstId(@android.hardware.radio.ProgramSelector.IdentifierType int);
    method @NonNull public android.hardware.radio.ProgramSelector.Identifier getPrimaryId();
    method @Deprecated @android.hardware.radio.ProgramSelector.ProgramType public int getProgramType();
    method @NonNull public android.hardware.radio.ProgramSelector.Identifier[] getSecondaryIds();
    method @Deprecated @NonNull public long[] getVendorIds();
    method @NonNull public android.hardware.radio.ProgramSelector withSecondaryPreferred(@NonNull android.hardware.radio.ProgramSelector.Identifier);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.radio.ProgramSelector> CREATOR;
    field public static final int IDENTIFIER_TYPE_AMFM_FREQUENCY = 1; // 0x1
    field public static final int IDENTIFIER_TYPE_DAB_ENSEMBLE = 6; // 0x6
    field public static final int IDENTIFIER_TYPE_DAB_FREQUENCY = 8; // 0x8
    field public static final int IDENTIFIER_TYPE_DAB_SCID = 7; // 0x7
    field public static final int IDENTIFIER_TYPE_DAB_SIDECC = 5; // 0x5
    field public static final int IDENTIFIER_TYPE_DAB_SID_EXT = 5; // 0x5
    field public static final int IDENTIFIER_TYPE_DRMO_FREQUENCY = 10; // 0xa
    field @Deprecated public static final int IDENTIFIER_TYPE_DRMO_MODULATION = 11; // 0xb
    field public static final int IDENTIFIER_TYPE_DRMO_SERVICE_ID = 9; // 0x9
    field public static final int IDENTIFIER_TYPE_HD_STATION_ID_EXT = 3; // 0x3
    field public static final int IDENTIFIER_TYPE_HD_STATION_NAME = 10004; // 0x2714
    field @Deprecated public static final int IDENTIFIER_TYPE_HD_SUBCHANNEL = 4; // 0x4
    field public static final int IDENTIFIER_TYPE_INVALID = 0; // 0x0
    field public static final int IDENTIFIER_TYPE_RDS_PI = 2; // 0x2
    field public static final int IDENTIFIER_TYPE_SXM_CHANNEL = 13; // 0xd
    field public static final int IDENTIFIER_TYPE_SXM_SERVICE_ID = 12; // 0xc
    field public static final int IDENTIFIER_TYPE_VENDOR_END = 1999; // 0x7cf
    field @Deprecated public static final int IDENTIFIER_TYPE_VENDOR_PRIMARY_END = 1999; // 0x7cf
    field @Deprecated public static final int IDENTIFIER_TYPE_VENDOR_PRIMARY_START = 1000; // 0x3e8
    field public static final int IDENTIFIER_TYPE_VENDOR_START = 1000; // 0x3e8
    field @Deprecated public static final int PROGRAM_TYPE_AM = 1; // 0x1
    field @Deprecated public static final int PROGRAM_TYPE_AM_HD = 3; // 0x3
    field @Deprecated public static final int PROGRAM_TYPE_DAB = 5; // 0x5
    field @Deprecated public static final int PROGRAM_TYPE_DRMO = 6; // 0x6
    field @Deprecated public static final int PROGRAM_TYPE_FM = 2; // 0x2
    field @Deprecated public static final int PROGRAM_TYPE_FM_HD = 4; // 0x4
    field @Deprecated public static final int PROGRAM_TYPE_INVALID = 0; // 0x0
    field @Deprecated public static final int PROGRAM_TYPE_SXM = 7; // 0x7
    field @Deprecated public static final int PROGRAM_TYPE_VENDOR_END = 1999; // 0x7cf
    field @Deprecated public static final int PROGRAM_TYPE_VENDOR_START = 1000; // 0x3e8
  }

  public static final class ProgramSelector.Identifier implements android.os.Parcelable {
    ctor public ProgramSelector.Identifier(@android.hardware.radio.ProgramSelector.IdentifierType int, long);
    method public int describeContents();
    method @android.hardware.radio.ProgramSelector.IdentifierType public int getType();
    method public long getValue();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.radio.ProgramSelector.Identifier> CREATOR;
  }

  @IntDef(prefix={"IDENTIFIER_TYPE_"}, value={android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_INVALID, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_AMFM_FREQUENCY, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_RDS_PI, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_HD_STATION_ID_EXT, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_HD_SUBCHANNEL, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_HD_STATION_NAME, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DAB_SID_EXT, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DAB_SIDECC, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DAB_ENSEMBLE, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DAB_SCID, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DAB_FREQUENCY, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DRMO_SERVICE_ID, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DRMO_FREQUENCY, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_DRMO_MODULATION, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_SXM_SERVICE_ID, android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_SXM_CHANNEL}) @IntRange(from=android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_VENDOR_START, to=android.hardware.radio.ProgramSelector.IDENTIFIER_TYPE_VENDOR_END) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ProgramSelector.IdentifierType {
  }

  @Deprecated @IntDef(prefix={"PROGRAM_TYPE_"}, value={android.hardware.radio.ProgramSelector.PROGRAM_TYPE_INVALID, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_AM, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_FM, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_AM_HD, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_FM_HD, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_DAB, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_DRMO, android.hardware.radio.ProgramSelector.PROGRAM_TYPE_SXM}) @IntRange(from=android.hardware.radio.ProgramSelector.PROGRAM_TYPE_VENDOR_START, to=android.hardware.radio.ProgramSelector.PROGRAM_TYPE_VENDOR_END) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ProgramSelector.ProgramType {
  }

  public class RadioManager {
    method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public void addAnnouncementListener(@NonNull java.util.Set<java.lang.Integer>, @NonNull android.hardware.radio.Announcement.OnListUpdatedListener);
    method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public void addAnnouncementListener(@NonNull java.util.concurrent.Executor, @NonNull java.util.Set<java.lang.Integer>, @NonNull android.hardware.radio.Announcement.OnListUpdatedListener);
    method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public int listModules(java.util.List<android.hardware.radio.RadioManager.ModuleProperties>);
    method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public android.hardware.radio.RadioTuner openTuner(int, android.hardware.radio.RadioManager.BandConfig, boolean, android.hardware.radio.RadioTuner.Callback, android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public void removeAnnouncementListener(@NonNull android.hardware.radio.Announcement.OnListUpdatedListener);
    field public static final int BAND_AM = 0; // 0x0
    field public static final int BAND_AM_HD = 3; // 0x3
    field public static final int BAND_FM = 1; // 0x1
    field public static final int BAND_FM_HD = 2; // 0x2
    field public static final int BAND_INVALID = -1; // 0xffffffff
    field public static final int CLASS_AM_FM = 0; // 0x0
    field public static final int CLASS_DT = 2; // 0x2
    field public static final int CLASS_SAT = 1; // 0x1
    field public static final int CONFIG_DAB_DAB_LINKING = 6; // 0x6
    field public static final int CONFIG_DAB_DAB_SOFT_LINKING = 8; // 0x8
    field public static final int CONFIG_DAB_FM_LINKING = 7; // 0x7
    field public static final int CONFIG_DAB_FM_SOFT_LINKING = 9; // 0x9
    field public static final int CONFIG_FORCE_ANALOG = 2; // 0x2
    field public static final int CONFIG_FORCE_DIGITAL = 3; // 0x3
    field public static final int CONFIG_FORCE_MONO = 1; // 0x1
    field public static final int CONFIG_RDS_AF = 4; // 0x4
    field public static final int CONFIG_RDS_REG = 5; // 0x5
    field public static final int REGION_ITU_1 = 0; // 0x0
    field public static final int REGION_ITU_2 = 1; // 0x1
    field public static final int REGION_JAPAN = 3; // 0x3
    field public static final int REGION_KOREA = 4; // 0x4
    field public static final int REGION_OIRT = 2; // 0x2
    field public static final int STATUS_BAD_VALUE = -22; // 0xffffffea
    field public static final int STATUS_DEAD_OBJECT = -32; // 0xffffffe0
    field public static final int STATUS_ERROR = -2147483648; // 0x80000000
    field public static final int STATUS_INVALID_OPERATION = -38; // 0xffffffda
    field public static final int STATUS_NO_INIT = -19; // 0xffffffed
    field public static final int STATUS_OK = 0; // 0x0
    field public static final int STATUS_PERMISSION_DENIED = -1; // 0xffffffff
    field public static final int STATUS_TIMED_OUT = -110; // 0xffffff92
  }

  public static class RadioManager.AmBandConfig extends android.hardware.radio.RadioManager.BandConfig {
    method public boolean getStereo();
    field public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.AmBandConfig> CREATOR;
  }

  public static class RadioManager.AmBandConfig.Builder {
    ctor public RadioManager.AmBandConfig.Builder(android.hardware.radio.RadioManager.AmBandDescriptor);
    ctor public RadioManager.AmBandConfig.Builder(android.hardware.radio.RadioManager.AmBandConfig);
    method public android.hardware.radio.RadioManager.AmBandConfig build();
    method public android.hardware.radio.RadioManager.AmBandConfig.Builder setStereo(boolean);
  }

  public static class RadioManager.AmBandDescriptor extends android.hardware.radio.RadioManager.BandDescriptor {
    method public boolean isStereoSupported();
    field public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.AmBandDescriptor> CREATOR;
  }

  @IntDef(prefix={"BAND_"}, value={android.hardware.radio.RadioManager.BAND_INVALID, android.hardware.radio.RadioManager.BAND_AM, android.hardware.radio.RadioManager.BAND_FM, android.hardware.radio.RadioManager.BAND_AM_HD, android.hardware.radio.RadioManager.BAND_FM_HD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface RadioManager.Band {
  }

  public static class RadioManager.BandConfig implements android.os.Parcelable {
    method public int describeContents();
    method public int getLowerLimit();
    method public int getRegion();
    method public int getSpacing();
    method public int getType();
    method public int getUpperLimit();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.BandConfig> CREATOR;
  }

  public static class RadioManager.BandDescriptor implements android.os.Parcelable {
    method public int describeContents();
    method public int getLowerLimit();
    method public int getRegion();
    method public int getSpacing();
    method public int getType();
    method public int getUpperLimit();
    method public boolean isAmBand();
    method public boolean isFmBand();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.BandDescriptor> CREATOR;
  }

  public static class RadioManager.FmBandConfig extends android.hardware.radio.RadioManager.BandConfig {
    method public boolean getAf();
    method public boolean getEa();
    method public boolean getRds();
    method public boolean getStereo();
    method public boolean getTa();
    field public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.FmBandConfig> CREATOR;
  }

  public static class RadioManager.FmBandConfig.Builder {
    ctor public RadioManager.FmBandConfig.Builder(android.hardware.radio.RadioManager.FmBandDescriptor);
    ctor public RadioManager.FmBandConfig.Builder(android.hardware.radio.RadioManager.FmBandConfig);
    method public android.hardware.radio.RadioManager.FmBandConfig build();
    method public android.hardware.radio.RadioManager.FmBandConfig.Builder setAf(boolean);
    method public android.hardware.radio.RadioManager.FmBandConfig.Builder setEa(boolean);
    method public android.hardware.radio.RadioManager.FmBandConfig.Builder setRds(boolean);
    method public android.hardware.radio.RadioManager.FmBandConfig.Builder setStereo(boolean);
    method public android.hardware.radio.RadioManager.FmBandConfig.Builder setTa(boolean);
  }

  public static class RadioManager.FmBandDescriptor extends android.hardware.radio.RadioManager.BandDescriptor {
    method public boolean isAfSupported();
    method public boolean isEaSupported();
    method public boolean isRdsSupported();
    method public boolean isStereoSupported();
    method public boolean isTaSupported();
    field public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.FmBandDescriptor> CREATOR;
  }

  public static class RadioManager.ModuleProperties implements android.os.Parcelable {
    method public int describeContents();
    method public android.hardware.radio.RadioManager.BandDescriptor[] getBands();
    method public int getClassId();
    method @Nullable public java.util.Map<java.lang.String,java.lang.Integer> getDabFrequencyTable();
    method public int getId();
    method public String getImplementor();
    method public int getNumAudioSources();
    method public int getNumTuners();
    method public String getProduct();
    method public String getSerial();
    method @NonNull public String getServiceName();
    method @NonNull public java.util.Map<java.lang.String,java.lang.String> getVendorInfo();
    method public String getVersion();
    method public boolean isBackgroundScanningSupported();
    method public boolean isCaptureSupported();
    method public boolean isInitializationRequired();
    method public boolean isProgramIdentifierSupported(@android.hardware.radio.ProgramSelector.IdentifierType int);
    method public boolean isProgramTypeSupported(@android.hardware.radio.ProgramSelector.ProgramType int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.ModuleProperties> CREATOR;
  }

  public static class RadioManager.ProgramInfo implements android.os.Parcelable {
    method public int describeContents();
    method @Deprecated public int getChannel();
    method @Nullable public android.hardware.radio.ProgramSelector.Identifier getLogicallyTunedTo();
    method public android.hardware.radio.RadioMetadata getMetadata();
    method @Nullable public android.hardware.radio.ProgramSelector.Identifier getPhysicallyTunedTo();
    method @Nullable public java.util.Collection<android.hardware.radio.ProgramSelector.Identifier> getRelatedContent();
    method @NonNull public android.hardware.radio.ProgramSelector getSelector();
    method public int getSignalStrength();
    method @Deprecated public int getSubChannel();
    method @NonNull public java.util.Map<java.lang.String,java.lang.String> getVendorInfo();
    method @Deprecated public boolean isDigital();
    method public boolean isLive();
    method public boolean isMuted();
    method public boolean isStereo();
    method public boolean isTrafficAnnouncementActive();
    method public boolean isTrafficProgram();
    method public boolean isTuned();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.radio.RadioManager.ProgramInfo> CREATOR;
  }

  public final class RadioMetadata implements android.os.Parcelable {
    method public boolean containsKey(String);
    method public int describeContents();
    method @Deprecated public android.graphics.Bitmap getBitmap(String);
    method public android.hardware.radio.RadioMetadata.Clock getClock(String);
    method public int getInt(String);
    method public String getString(String);
    method public java.util.Set<java.lang.String> keySet();
    method public int size();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.radio.RadioMetadata> CREATOR;
    field public static final String METADATA_KEY_ALBUM = "android.hardware.radio.metadata.ALBUM";
    field public static final String METADATA_KEY_ART = "android.hardware.radio.metadata.ART";
    field public static final String METADATA_KEY_ARTIST = "android.hardware.radio.metadata.ARTIST";
    field public static final String METADATA_KEY_CLOCK = "android.hardware.radio.metadata.CLOCK";
    field public static final String METADATA_KEY_DAB_COMPONENT_NAME = "android.hardware.radio.metadata.DAB_COMPONENT_NAME";
    field public static final String METADATA_KEY_DAB_COMPONENT_NAME_SHORT = "android.hardware.radio.metadata.DAB_COMPONENT_NAME_SHORT";
    field public static final String METADATA_KEY_DAB_ENSEMBLE_NAME = "android.hardware.radio.metadata.DAB_ENSEMBLE_NAME";
    field public static final String METADATA_KEY_DAB_ENSEMBLE_NAME_SHORT = "android.hardware.radio.metadata.DAB_ENSEMBLE_NAME_SHORT";
    field public static final String METADATA_KEY_DAB_SERVICE_NAME = "android.hardware.radio.metadata.DAB_SERVICE_NAME";
    field public static final String METADATA_KEY_DAB_SERVICE_NAME_SHORT = "android.hardware.radio.metadata.DAB_SERVICE_NAME_SHORT";
    field public static final String METADATA_KEY_GENRE = "android.hardware.radio.metadata.GENRE";
    field public static final String METADATA_KEY_ICON = "android.hardware.radio.metadata.ICON";
    field public static final String METADATA_KEY_PROGRAM_NAME = "android.hardware.radio.metadata.PROGRAM_NAME";
    field public static final String METADATA_KEY_RBDS_PTY = "android.hardware.radio.metadata.RBDS_PTY";
    field public static final String METADATA_KEY_RDS_PI = "android.hardware.radio.metadata.RDS_PI";
    field public static final String METADATA_KEY_RDS_PS = "android.hardware.radio.metadata.RDS_PS";
    field public static final String METADATA_KEY_RDS_PTY = "android.hardware.radio.metadata.RDS_PTY";
    field public static final String METADATA_KEY_RDS_RT = "android.hardware.radio.metadata.RDS_RT";
    field public static final String METADATA_KEY_TITLE = "android.hardware.radio.metadata.TITLE";
  }

  public static final class RadioMetadata.Builder {
    ctor public RadioMetadata.Builder();
    ctor public RadioMetadata.Builder(android.hardware.radio.RadioMetadata);
    method public android.hardware.radio.RadioMetadata build();
    method public android.hardware.radio.RadioMetadata.Builder putBitmap(String, android.graphics.Bitmap);
    method public android.hardware.radio.RadioMetadata.Builder putClock(String, long, int);
    method public android.hardware.radio.RadioMetadata.Builder putInt(String, int);
    method public android.hardware.radio.RadioMetadata.Builder putString(String, String);
  }

  public static final class RadioMetadata.Clock implements android.os.Parcelable {
    ctor public RadioMetadata.Clock(long, int);
    method public int describeContents();
    method public int getTimezoneOffsetMinutes();
    method public long getUtcEpochSeconds();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.radio.RadioMetadata.Clock> CREATOR;
  }

  public abstract class RadioTuner {
    ctor public RadioTuner();
    method public abstract int cancel();
    method public abstract void cancelAnnouncement();
    method public abstract void close();
    method @Deprecated public abstract int getConfiguration(android.hardware.radio.RadioManager.BandConfig[]);
    method @Nullable public android.hardware.radio.ProgramList getDynamicProgramList(@Nullable android.hardware.radio.ProgramList.Filter);
    method public abstract boolean getMute();
    method @NonNull public java.util.Map<java.lang.String,java.lang.String> getParameters(@NonNull java.util.List<java.lang.String>);
    method @Deprecated public abstract int getProgramInformation(android.hardware.radio.RadioManager.ProgramInfo[]);
    method @Deprecated @NonNull public abstract java.util.List<android.hardware.radio.RadioManager.ProgramInfo> getProgramList(@Nullable java.util.Map<java.lang.String,java.lang.String>);
    method public abstract boolean hasControl();
    method @Deprecated public abstract boolean isAnalogForced();
    method @Deprecated public abstract boolean isAntennaConnected();
    method public boolean isConfigFlagSet(int);
    method public boolean isConfigFlagSupported(int);
    method public abstract int scan(int, boolean);
    method @Deprecated public abstract void setAnalogForced(boolean);
    method public void setConfigFlag(int, boolean);
    method @Deprecated public abstract int setConfiguration(android.hardware.radio.RadioManager.BandConfig);
    method public abstract int setMute(boolean);
    method @NonNull public java.util.Map<java.lang.String,java.lang.String> setParameters(@NonNull java.util.Map<java.lang.String,java.lang.String>);
    method public abstract boolean startBackgroundScan();
    method public abstract int step(int, boolean);
    method @Deprecated public abstract int tune(int, int);
    method public abstract void tune(@NonNull android.hardware.radio.ProgramSelector);
    field public static final int DIRECTION_DOWN = 1; // 0x1
    field public static final int DIRECTION_UP = 0; // 0x0
    field @Deprecated public static final int ERROR_BACKGROUND_SCAN_FAILED = 6; // 0x6
    field @Deprecated public static final int ERROR_BACKGROUND_SCAN_UNAVAILABLE = 5; // 0x5
    field @Deprecated public static final int ERROR_CANCELLED = 2; // 0x2
    field @Deprecated public static final int ERROR_CONFIG = 4; // 0x4
    field @Deprecated public static final int ERROR_HARDWARE_FAILURE = 0; // 0x0
    field @Deprecated public static final int ERROR_SCAN_TIMEOUT = 3; // 0x3
    field @Deprecated public static final int ERROR_SERVER_DIED = 1; // 0x1
  }

  public abstract static class RadioTuner.Callback {
    ctor public RadioTuner.Callback();
    method public void onAntennaState(boolean);
    method public void onBackgroundScanAvailabilityChange(boolean);
    method public void onBackgroundScanComplete();
    method @Deprecated public void onConfigurationChanged(android.hardware.radio.RadioManager.BandConfig);
    method public void onControlChanged(boolean);
    method public void onEmergencyAnnouncement(boolean);
    method @Deprecated public void onError(int);
    method @Deprecated public void onMetadataChanged(android.hardware.radio.RadioMetadata);
    method public void onParametersUpdated(@NonNull java.util.Map<java.lang.String,java.lang.String>);
    method public void onProgramInfoChanged(android.hardware.radio.RadioManager.ProgramInfo);
    method public void onProgramListChanged();
    method public void onTrafficAnnouncement(boolean);
    method public void onTuneFailed(int, @Nullable android.hardware.radio.ProgramSelector);
  }

}

package android.hardware.soundtrigger {

  public class SoundTrigger {
    field public static final int STATUS_OK = 0; // 0x0
  }

  public static class SoundTrigger.RecognitionEvent {
    method @Nullable public android.media.AudioFormat getCaptureFormat();
    method public int getCaptureSession();
    method public byte[] getData();
    method public boolean isCaptureAvailable();
  }

}

package android.hardware.usb {

  public class UsbDeviceConnection {
    method public boolean resetDevice();
  }

  public class UsbManager {
    method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public void grantPermission(android.hardware.usb.UsbDevice, String);
  }

}

package android.location {

  public abstract class BatchedLocationCallback {
    ctor public BatchedLocationCallback();
    method public void onLocationBatch(java.util.List<android.location.Location>);
  }

  public class GpsClock implements android.os.Parcelable {
    method public int describeContents();
    method public double getBiasInNs();
    method public double getBiasUncertaintyInNs();
    method public double getDriftInNsPerSec();
    method public double getDriftUncertaintyInNsPerSec();
    method public long getFullBiasInNs();
    method public short getLeapSecond();
    method public long getTimeInNs();
    method public double getTimeUncertaintyInNs();
    method public byte getType();
    method public boolean hasBiasInNs();
    method public boolean hasBiasUncertaintyInNs();
    method public boolean hasDriftInNsPerSec();
    method public boolean hasDriftUncertaintyInNsPerSec();
    method public boolean hasFullBiasInNs();
    method public boolean hasLeapSecond();
    method public boolean hasTimeUncertaintyInNs();
    method public void reset();
    method public void resetBiasInNs();
    method public void resetBiasUncertaintyInNs();
    method public void resetDriftInNsPerSec();
    method public void resetDriftUncertaintyInNsPerSec();
    method public void resetFullBiasInNs();
    method public void resetLeapSecond();
    method public void resetTimeUncertaintyInNs();
    method public void set(android.location.GpsClock);
    method public void setBiasInNs(double);
    method public void setBiasUncertaintyInNs(double);
    method public void setDriftInNsPerSec(double);
    method public void setDriftUncertaintyInNsPerSec(double);
    method public void setFullBiasInNs(long);
    method public void setLeapSecond(short);
    method public void setTimeInNs(long);
    method public void setTimeUncertaintyInNs(double);
    method public void setType(byte);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GpsClock> CREATOR;
    field public static final byte TYPE_GPS_TIME = 2; // 0x2
    field public static final byte TYPE_LOCAL_HW_TIME = 1; // 0x1
    field public static final byte TYPE_UNKNOWN = 0; // 0x0
  }

  public class GpsMeasurement implements android.os.Parcelable {
    method public int describeContents();
    method public double getAccumulatedDeltaRangeInMeters();
    method public short getAccumulatedDeltaRangeState();
    method public double getAccumulatedDeltaRangeUncertaintyInMeters();
    method public double getAzimuthInDeg();
    method public double getAzimuthUncertaintyInDeg();
    method public int getBitNumber();
    method public long getCarrierCycles();
    method public float getCarrierFrequencyInHz();
    method public double getCarrierPhase();
    method public double getCarrierPhaseUncertainty();
    method public double getCn0InDbHz();
    method public double getCodePhaseInChips();
    method public double getCodePhaseUncertaintyInChips();
    method public double getDopplerShiftInHz();
    method public double getDopplerShiftUncertaintyInHz();
    method public double getElevationInDeg();
    method public double getElevationUncertaintyInDeg();
    method public byte getLossOfLock();
    method public byte getMultipathIndicator();
    method public byte getPrn();
    method public double getPseudorangeInMeters();
    method public double getPseudorangeRateInMetersPerSec();
    method public double getPseudorangeRateUncertaintyInMetersPerSec();
    method public double getPseudorangeUncertaintyInMeters();
    method public long getReceivedGpsTowInNs();
    method public long getReceivedGpsTowUncertaintyInNs();
    method public double getSnrInDb();
    method public short getState();
    method public short getTimeFromLastBitInMs();
    method public double getTimeOffsetInNs();
    method public boolean hasAzimuthInDeg();
    method public boolean hasAzimuthUncertaintyInDeg();
    method public boolean hasBitNumber();
    method public boolean hasCarrierCycles();
    method public boolean hasCarrierFrequencyInHz();
    method public boolean hasCarrierPhase();
    method public boolean hasCarrierPhaseUncertainty();
    method public boolean hasCodePhaseInChips();
    method public boolean hasCodePhaseUncertaintyInChips();
    method public boolean hasDopplerShiftInHz();
    method public boolean hasDopplerShiftUncertaintyInHz();
    method public boolean hasElevationInDeg();
    method public boolean hasElevationUncertaintyInDeg();
    method public boolean hasPseudorangeInMeters();
    method public boolean hasPseudorangeUncertaintyInMeters();
    method public boolean hasSnrInDb();
    method public boolean hasTimeFromLastBitInMs();
    method public boolean isPseudorangeRateCorrected();
    method public boolean isUsedInFix();
    method public void reset();
    method public void resetAzimuthInDeg();
    method public void resetAzimuthUncertaintyInDeg();
    method public void resetBitNumber();
    method public void resetCarrierCycles();
    method public void resetCarrierFrequencyInHz();
    method public void resetCarrierPhase();
    method public void resetCarrierPhaseUncertainty();
    method public void resetCodePhaseInChips();
    method public void resetCodePhaseUncertaintyInChips();
    method public void resetDopplerShiftInHz();
    method public void resetDopplerShiftUncertaintyInHz();
    method public void resetElevationInDeg();
    method public void resetElevationUncertaintyInDeg();
    method public void resetPseudorangeInMeters();
    method public void resetPseudorangeUncertaintyInMeters();
    method public void resetSnrInDb();
    method public void resetTimeFromLastBitInMs();
    method public void set(android.location.GpsMeasurement);
    method public void setAccumulatedDeltaRangeInMeters(double);
    method public void setAccumulatedDeltaRangeState(short);
    method public void setAccumulatedDeltaRangeUncertaintyInMeters(double);
    method public void setAzimuthInDeg(double);
    method public void setAzimuthUncertaintyInDeg(double);
    method public void setBitNumber(int);
    method public void setCarrierCycles(long);
    method public void setCarrierFrequencyInHz(float);
    method public void setCarrierPhase(double);
    method public void setCarrierPhaseUncertainty(double);
    method public void setCn0InDbHz(double);
    method public void setCodePhaseInChips(double);
    method public void setCodePhaseUncertaintyInChips(double);
    method public void setDopplerShiftInHz(double);
    method public void setDopplerShiftUncertaintyInHz(double);
    method public void setElevationInDeg(double);
    method public void setElevationUncertaintyInDeg(double);
    method public void setLossOfLock(byte);
    method public void setMultipathIndicator(byte);
    method public void setPrn(byte);
    method public void setPseudorangeInMeters(double);
    method public void setPseudorangeRateInMetersPerSec(double);
    method public void setPseudorangeRateUncertaintyInMetersPerSec(double);
    method public void setPseudorangeUncertaintyInMeters(double);
    method public void setReceivedGpsTowInNs(long);
    method public void setReceivedGpsTowUncertaintyInNs(long);
    method public void setSnrInDb(double);
    method public void setState(short);
    method public void setTimeFromLastBitInMs(short);
    method public void setTimeOffsetInNs(double);
    method public void setUsedInFix(boolean);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final short ADR_STATE_CYCLE_SLIP = 4; // 0x4
    field public static final short ADR_STATE_RESET = 2; // 0x2
    field public static final short ADR_STATE_UNKNOWN = 0; // 0x0
    field public static final short ADR_STATE_VALID = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.location.GpsMeasurement> CREATOR;
    field public static final byte LOSS_OF_LOCK_CYCLE_SLIP = 2; // 0x2
    field public static final byte LOSS_OF_LOCK_OK = 1; // 0x1
    field public static final byte LOSS_OF_LOCK_UNKNOWN = 0; // 0x0
    field public static final byte MULTIPATH_INDICATOR_DETECTED = 1; // 0x1
    field public static final byte MULTIPATH_INDICATOR_NOT_USED = 2; // 0x2
    field public static final byte MULTIPATH_INDICATOR_UNKNOWN = 0; // 0x0
    field public static final short STATE_BIT_SYNC = 2; // 0x2
    field public static final short STATE_CODE_LOCK = 1; // 0x1
    field public static final short STATE_MSEC_AMBIGUOUS = 16; // 0x10
    field public static final short STATE_SUBFRAME_SYNC = 4; // 0x4
    field public static final short STATE_TOW_DECODED = 8; // 0x8
    field public static final short STATE_UNKNOWN = 0; // 0x0
  }

  public class GpsMeasurementsEvent implements android.os.Parcelable {
    ctor public GpsMeasurementsEvent(android.location.GpsClock, android.location.GpsMeasurement[]);
    method public int describeContents();
    method @NonNull public android.location.GpsClock getClock();
    method @NonNull public java.util.Collection<android.location.GpsMeasurement> getMeasurements();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GpsMeasurementsEvent> CREATOR;
    field public static final int STATUS_GPS_LOCATION_DISABLED = 2; // 0x2
    field public static final int STATUS_NOT_SUPPORTED = 0; // 0x0
    field public static final int STATUS_READY = 1; // 0x1
  }

  public static interface GpsMeasurementsEvent.Listener {
    method public void onGpsMeasurementsReceived(android.location.GpsMeasurementsEvent);
    method public void onStatusChanged(int);
  }

  public class GpsNavigationMessage implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public byte[] getData();
    method public short getMessageId();
    method public byte getPrn();
    method public short getStatus();
    method public short getSubmessageId();
    method public byte getType();
    method public void reset();
    method public void set(android.location.GpsNavigationMessage);
    method public void setData(byte[]);
    method public void setMessageId(short);
    method public void setPrn(byte);
    method public void setStatus(short);
    method public void setSubmessageId(short);
    method public void setType(byte);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GpsNavigationMessage> CREATOR;
    field public static final short STATUS_PARITY_PASSED = 1; // 0x1
    field public static final short STATUS_PARITY_REBUILT = 2; // 0x2
    field public static final short STATUS_UNKNOWN = 0; // 0x0
    field public static final byte TYPE_CNAV2 = 4; // 0x4
    field public static final byte TYPE_L1CA = 1; // 0x1
    field public static final byte TYPE_L2CNAV = 2; // 0x2
    field public static final byte TYPE_L5CNAV = 3; // 0x3
    field public static final byte TYPE_UNKNOWN = 0; // 0x0
  }

  public class GpsNavigationMessageEvent implements android.os.Parcelable {
    ctor public GpsNavigationMessageEvent(android.location.GpsNavigationMessage);
    method public int describeContents();
    method @NonNull public android.location.GpsNavigationMessage getNavigationMessage();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GpsNavigationMessageEvent> CREATOR;
    field public static int STATUS_GPS_LOCATION_DISABLED;
    field public static int STATUS_NOT_SUPPORTED;
    field public static int STATUS_READY;
  }

  public static interface GpsNavigationMessageEvent.Listener {
    method public void onGpsNavigationMessageReceived(android.location.GpsNavigationMessageEvent);
    method public void onStatusChanged(int);
  }

  public class Location implements android.os.Parcelable {
    method public boolean isComplete();
    method public void makeComplete();
    method public void setIsFromMockProvider(boolean);
  }

  public class LocationManager {
    method @Deprecated public boolean addGpsMeasurementListener(android.location.GpsMeasurementsEvent.Listener);
    method @Deprecated public boolean addGpsNavigationMessageListener(android.location.GpsNavigationMessageEvent.Listener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void flushGnssBatch();
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int getGnssBatchSize();
    method public boolean isLocationEnabledForUser(android.os.UserHandle);
    method public boolean isProviderEnabledForUser(String, android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean registerGnssBatchedLocationCallback(long, boolean, android.location.BatchedLocationCallback, android.os.Handler);
    method @Deprecated public void removeGpsMeasurementListener(android.location.GpsMeasurementsEvent.Listener);
    method @Deprecated public void removeGpsNavigationMessageListener(android.location.GpsNavigationMessageEvent.Listener);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(android.location.LocationRequest, android.location.LocationListener, android.os.Looper);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(android.location.LocationRequest, android.app.PendingIntent);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setLocationEnabledForUser(boolean, android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean setProviderEnabledForUser(String, boolean, android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean unregisterGnssBatchedLocationCallback(android.location.BatchedLocationCallback);
  }

  public final class LocationRequest implements android.os.Parcelable {
    method public static android.location.LocationRequest create();
    method public static android.location.LocationRequest createFromDeprecatedCriteria(android.location.Criteria, long, float, boolean);
    method public static android.location.LocationRequest createFromDeprecatedProvider(String, long, float, boolean);
    method public int describeContents();
    method public long getExpireAt();
    method public long getFastestInterval();
    method public boolean getHideFromAppOps();
    method public long getInterval();
    method public int getNumUpdates();
    method public String getProvider();
    method public int getQuality();
    method public float getSmallestDisplacement();
    method public android.os.WorkSource getWorkSource();
    method public boolean isLowPowerMode();
    method public android.location.LocationRequest setExpireAt(long);
    method public android.location.LocationRequest setExpireIn(long);
    method public android.location.LocationRequest setFastestInterval(long);
    method public void setHideFromAppOps(boolean);
    method public android.location.LocationRequest setInterval(long);
    method public android.location.LocationRequest setLowPowerMode(boolean);
    method public android.location.LocationRequest setNumUpdates(int);
    method public android.location.LocationRequest setProvider(String);
    method public android.location.LocationRequest setQuality(int);
    method public android.location.LocationRequest setSmallestDisplacement(float);
    method public void setWorkSource(android.os.WorkSource);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ACCURACY_BLOCK = 102; // 0x66
    field public static final int ACCURACY_CITY = 104; // 0x68
    field public static final int ACCURACY_FINE = 100; // 0x64
    field public static final android.os.Parcelable.Creator<android.location.LocationRequest> CREATOR;
    field public static final int POWER_HIGH = 203; // 0xcb
    field public static final int POWER_LOW = 201; // 0xc9
    field public static final int POWER_NONE = 200; // 0xc8
  }

}

package android.media {

  public final class AudioAttributes implements android.os.Parcelable {
    method public int getAllFlags();
    method public android.os.Bundle getBundle();
    method public int getCapturePreset();
    field public static final int FLAG_BEACON = 8; // 0x8
    field public static final int FLAG_BYPASS_INTERRUPTION_POLICY = 64; // 0x40
    field public static final int FLAG_BYPASS_MUTE = 128; // 0x80
    field public static final int FLAG_HW_HOTWORD = 32; // 0x20
  }

  public static class AudioAttributes.Builder {
    method public android.media.AudioAttributes.Builder addBundle(@NonNull android.os.Bundle);
    method public android.media.AudioAttributes.Builder setCapturePreset(int);
    method public android.media.AudioAttributes.Builder setInternalCapturePreset(int);
  }

  public final class AudioFocusInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.media.AudioAttributes getAttributes();
    method public String getClientId();
    method public int getClientUid();
    method public int getFlags();
    method public int getGainRequest();
    method public int getLossReceived();
    method public String getPackageName();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.AudioFocusInfo> CREATOR;
  }

  public final class AudioFocusRequest {
    method public boolean locksFocus();
  }

  public static final class AudioFocusRequest.Builder {
    method @NonNull public android.media.AudioFocusRequest.Builder setLocksFocus(boolean);
  }

  public class AudioManager {
    method @Deprecated public int abandonAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, android.media.AudioAttributes);
    method public void clearAudioServerStateCallback();
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int dispatchAudioFocusChange(@NonNull android.media.AudioFocusInfo, int, @NonNull android.media.audiopolicy.AudioPolicy);
    method public boolean isAudioServerRunning();
    method public boolean isHdmiSystemAudioSupported();
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int registerAudioPolicy(@NonNull android.media.audiopolicy.AudioPolicy);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, @NonNull android.media.AudioAttributes, int, int) throws java.lang.IllegalArgumentException;
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.MODIFY_AUDIO_ROUTING}) public int requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, @NonNull android.media.AudioAttributes, int, int, android.media.audiopolicy.AudioPolicy) throws java.lang.IllegalArgumentException;
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int requestAudioFocus(@NonNull android.media.AudioFocusRequest, @Nullable android.media.audiopolicy.AudioPolicy);
    method public void setAudioServerStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.AudioServerStateCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void setFocusRequestResult(@NonNull android.media.AudioFocusInfo, int, @NonNull android.media.audiopolicy.AudioPolicy);
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void unregisterAudioPolicyAsync(@NonNull android.media.audiopolicy.AudioPolicy);
    field public static final int AUDIOFOCUS_FLAG_DELAY_OK = 1; // 0x1
    field public static final int AUDIOFOCUS_FLAG_LOCK = 4; // 0x4
    field public static final int AUDIOFOCUS_FLAG_PAUSES_ON_DUCKABLE_LOSS = 2; // 0x2
  }

  public abstract static class AudioManager.AudioServerStateCallback {
    ctor public AudioManager.AudioServerStateCallback();
    method public void onAudioServerDown();
    method public void onAudioServerUp();
  }

  public final class AudioPlaybackConfiguration implements android.os.Parcelable {
    method public int getClientPid();
    method public int getClientUid();
    method public int getPlayerInterfaceId();
    method public android.media.PlayerProxy getPlayerProxy();
    method public int getPlayerState();
    method public int getPlayerType();
    field public static final int PLAYER_STATE_IDLE = 1; // 0x1
    field public static final int PLAYER_STATE_PAUSED = 3; // 0x3
    field public static final int PLAYER_STATE_RELEASED = 0; // 0x0
    field public static final int PLAYER_STATE_STARTED = 2; // 0x2
    field public static final int PLAYER_STATE_STOPPED = 4; // 0x4
    field public static final int PLAYER_STATE_UNKNOWN = -1; // 0xffffffff
    field public static final int PLAYER_TYPE_JAM_AUDIOTRACK = 1; // 0x1
    field public static final int PLAYER_TYPE_JAM_MEDIAPLAYER = 2; // 0x2
    field public static final int PLAYER_TYPE_JAM_SOUNDPOOL = 3; // 0x3
    field public static final int PLAYER_TYPE_SLES_AUDIOPLAYER_BUFFERQUEUE = 11; // 0xb
    field public static final int PLAYER_TYPE_SLES_AUDIOPLAYER_URI_FD = 12; // 0xc
    field public static final int PLAYER_TYPE_UNKNOWN = -1; // 0xffffffff
  }

  public class AudioRecord implements android.media.AudioRouting {
    ctor public AudioRecord(android.media.AudioAttributes, android.media.AudioFormat, int, int) throws java.lang.IllegalArgumentException;
  }

  public static class AudioRecord.Builder {
    method public android.media.AudioRecord.Builder setAudioAttributes(@NonNull android.media.AudioAttributes) throws java.lang.IllegalArgumentException;
    method public android.media.AudioRecord.Builder setSessionId(int) throws java.lang.IllegalArgumentException;
  }

  public final class MediaRecorder.AudioSource {
    field @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_HOTWORD) public static final int HOTWORD = 1999; // 0x7cf
    field public static final int RADIO_TUNER = 1998; // 0x7ce
  }

  public class PlayerProxy {
    method public void pause();
    method public void setPan(float);
    method public void setStartDelayMs(int);
    method public void setVolume(float);
    method public void start();
    method public void stop();
  }

}

package android.media.audiopolicy {

  public class AudioMix {
    method public int getMixState();
    field public static final int MIX_STATE_DISABLED = -1; // 0xffffffff
    field public static final int MIX_STATE_IDLE = 0; // 0x0
    field public static final int MIX_STATE_MIXING = 1; // 0x1
    field public static final int ROUTE_FLAG_LOOP_BACK = 2; // 0x2
    field public static final int ROUTE_FLAG_RENDER = 1; // 0x1
  }

  public static class AudioMix.Builder {
    ctor public AudioMix.Builder(android.media.audiopolicy.AudioMixingRule) throws java.lang.IllegalArgumentException;
    method public android.media.audiopolicy.AudioMix build() throws java.lang.IllegalArgumentException;
    method public android.media.audiopolicy.AudioMix.Builder setDevice(@NonNull android.media.AudioDeviceInfo) throws java.lang.IllegalArgumentException;
    method public android.media.audiopolicy.AudioMix.Builder setFormat(android.media.AudioFormat) throws java.lang.IllegalArgumentException;
    method public android.media.audiopolicy.AudioMix.Builder setRouteFlags(int) throws java.lang.IllegalArgumentException;
  }

  public class AudioMixingRule {
    field public static final int RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET = 2; // 0x2
    field public static final int RULE_MATCH_ATTRIBUTE_USAGE = 1; // 0x1
    field public static final int RULE_MATCH_UID = 4; // 0x4
  }

  public static class AudioMixingRule.Builder {
    ctor public AudioMixingRule.Builder();
    method public android.media.audiopolicy.AudioMixingRule.Builder addMixRule(int, Object) throws java.lang.IllegalArgumentException;
    method public android.media.audiopolicy.AudioMixingRule.Builder addRule(android.media.AudioAttributes, int) throws java.lang.IllegalArgumentException;
    method public android.media.audiopolicy.AudioMixingRule build();
    method public android.media.audiopolicy.AudioMixingRule.Builder excludeMixRule(int, Object) throws java.lang.IllegalArgumentException;
    method public android.media.audiopolicy.AudioMixingRule.Builder excludeRule(android.media.AudioAttributes, int) throws java.lang.IllegalArgumentException;
  }

  public class AudioPolicy {
    method public int attachMixes(@NonNull java.util.List<android.media.audiopolicy.AudioMix>);
    method public android.media.AudioRecord createAudioRecordSink(android.media.audiopolicy.AudioMix) throws java.lang.IllegalArgumentException;
    method public android.media.AudioTrack createAudioTrackSource(android.media.audiopolicy.AudioMix) throws java.lang.IllegalArgumentException;
    method public int detachMixes(@NonNull java.util.List<android.media.audiopolicy.AudioMix>);
    method public int getFocusDuckingBehavior();
    method public int getStatus();
    method public int setFocusDuckingBehavior(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setRegistration(String);
    method public String toLogFriendlyString();
    field public static final int FOCUS_POLICY_DUCKING_DEFAULT = 0; // 0x0
    field public static final int FOCUS_POLICY_DUCKING_IN_APP = 0; // 0x0
    field public static final int FOCUS_POLICY_DUCKING_IN_POLICY = 1; // 0x1
    field public static final int POLICY_STATUS_REGISTERED = 2; // 0x2
    field public static final int POLICY_STATUS_UNREGISTERED = 1; // 0x1
  }

  public abstract static class AudioPolicy.AudioPolicyFocusListener {
    ctor public AudioPolicy.AudioPolicyFocusListener();
    method public void onAudioFocusAbandon(android.media.AudioFocusInfo);
    method public void onAudioFocusGrant(android.media.AudioFocusInfo, int);
    method public void onAudioFocusLoss(android.media.AudioFocusInfo, boolean);
    method public void onAudioFocusRequest(android.media.AudioFocusInfo, int);
  }

  public abstract static class AudioPolicy.AudioPolicyStatusListener {
    ctor public AudioPolicy.AudioPolicyStatusListener();
    method public void onMixStateUpdate(android.media.audiopolicy.AudioMix);
    method public void onStatusChange();
  }

  public abstract static class AudioPolicy.AudioPolicyVolumeCallback {
    method public void onVolumeAdjustment(int);
  }

  public static class AudioPolicy.Builder {
    ctor public AudioPolicy.Builder(android.content.Context);
    method public android.media.audiopolicy.AudioPolicy.Builder addMix(@NonNull android.media.audiopolicy.AudioMix) throws java.lang.IllegalArgumentException;
    method public android.media.audiopolicy.AudioPolicy build();
    method public void setAudioPolicyFocusListener(android.media.audiopolicy.AudioPolicy.AudioPolicyFocusListener);
    method public void setAudioPolicyStatusListener(android.media.audiopolicy.AudioPolicy.AudioPolicyStatusListener);
    method public android.media.audiopolicy.AudioPolicy.Builder setAudioPolicyVolumeCallback(@NonNull android.media.audiopolicy.AudioPolicy.AudioPolicyVolumeCallback);
    method public android.media.audiopolicy.AudioPolicy.Builder setIsAudioFocusPolicy(boolean);
    method public android.media.audiopolicy.AudioPolicy.Builder setLooper(@NonNull android.os.Looper) throws java.lang.IllegalArgumentException;
  }

}

package android.media.session {

  public final class MediaSessionManager {
    method @RequiresPermission(android.Manifest.permission.SET_MEDIA_KEY_LISTENER) public void setOnMediaKeyListener(android.media.session.MediaSessionManager.OnMediaKeyListener, @Nullable android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER) public void setOnVolumeKeyLongPressListener(android.media.session.MediaSessionManager.OnVolumeKeyLongPressListener, @Nullable android.os.Handler);
  }

  public static interface MediaSessionManager.OnMediaKeyListener {
    method public boolean onMediaKey(android.view.KeyEvent);
  }

  public static interface MediaSessionManager.OnVolumeKeyLongPressListener {
    method public void onVolumeKeyLongPress(android.view.KeyEvent);
  }

}

package android.media.soundtrigger {

  public abstract class SoundTriggerDetectionService extends android.app.Service {
    ctor public SoundTriggerDetectionService();
    method @MainThread public void onConnected(@NonNull java.util.UUID, @Nullable android.os.Bundle);
    method @MainThread public void onDisconnected(@NonNull java.util.UUID, @Nullable android.os.Bundle);
    method @MainThread public void onError(@NonNull java.util.UUID, @Nullable android.os.Bundle, int, int);
    method @MainThread public void onGenericRecognitionEvent(@NonNull java.util.UUID, @Nullable android.os.Bundle, int, @NonNull android.hardware.soundtrigger.SoundTrigger.RecognitionEvent);
    method @MainThread public abstract void onStopOperation(@NonNull java.util.UUID, @Nullable android.os.Bundle, int);
    method public final void operationFinished(@Nullable java.util.UUID, int);
  }

  public final class SoundTriggerDetector {
    method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public boolean startRecognition(int);
    method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public boolean stopRecognition();
    field public static final int RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS = 2; // 0x2
    field public static final int RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO = 1; // 0x1
  }

  public abstract static class SoundTriggerDetector.Callback {
    ctor public SoundTriggerDetector.Callback();
    method public abstract void onAvailabilityChanged(int);
    method public abstract void onDetected(@NonNull android.media.soundtrigger.SoundTriggerDetector.EventPayload);
    method public abstract void onError();
    method public abstract void onRecognitionPaused();
    method public abstract void onRecognitionResumed();
  }

  public static class SoundTriggerDetector.EventPayload {
    method @Nullable public android.media.AudioFormat getCaptureAudioFormat();
    method @Nullable public byte[] getTriggerAudio();
  }

  public final class SoundTriggerManager {
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public android.media.soundtrigger.SoundTriggerDetector createSoundTriggerDetector(java.util.UUID, @NonNull android.media.soundtrigger.SoundTriggerDetector.Callback, @Nullable android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public void deleteModel(java.util.UUID);
    method public int getDetectionServiceOperationsTimeout();
    method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public android.media.soundtrigger.SoundTriggerManager.Model getModel(java.util.UUID);
    method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public void updateModel(android.media.soundtrigger.SoundTriggerManager.Model);
  }

  public static class SoundTriggerManager.Model {
    method public static android.media.soundtrigger.SoundTriggerManager.Model create(java.util.UUID, java.util.UUID, byte[]);
    method public byte[] getModelData();
    method public java.util.UUID getModelUuid();
    method public java.util.UUID getVendorUuid();
  }

}

package android.media.tv {

  public final class TvContentRatingSystemInfo implements android.os.Parcelable {
    method public static android.media.tv.TvContentRatingSystemInfo createTvContentRatingSystemInfo(int, android.content.pm.ApplicationInfo);
    method public int describeContents();
    method public android.net.Uri getXmlUri();
    method public boolean isSystemDefined();
    method public void writeToParcel(android.os.Parcel, int);
  }

  public final class TvContract {
    method public static android.net.Uri buildChannelsUriForInput(@Nullable String, boolean);
    method public static android.net.Uri buildChannelsUriForInput(@Nullable String, @Nullable String, boolean);
    field public static final String ACTION_CHANNEL_BROWSABLE_REQUESTED = "android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED";
    field public static final String EXTRA_BLOCKED_PACKAGES = "android.media.tv.extra.BLOCKED_PACKAGES";
    field public static final String EXTRA_COLUMN_NAME = "android.media.tv.extra.COLUMN_NAME";
    field public static final String EXTRA_DATA_TYPE = "android.media.tv.extra.DATA_TYPE";
    field public static final String EXTRA_DEFAULT_VALUE = "android.media.tv.extra.DEFAULT_VALUE";
    field public static final String EXTRA_EXISTING_COLUMN_NAMES = "android.media.tv.extra.EXISTING_COLUMN_NAMES";
    field public static final String EXTRA_PACKAGE_NAME = "android.media.tv.extra.PACKAGE_NAME";
    field public static final String EXTRA_RESULT_CODE = "android.media.tv.extra.RESULT_CODE";
    field public static final String METHOD_ADD_COLUMN = "add_column";
    field public static final String METHOD_BLOCK_PACKAGE = "block_package";
    field public static final String METHOD_GET_BLOCKED_PACKAGES = "get_blocked_packages";
    field public static final String METHOD_GET_COLUMNS = "get_columns";
    field public static final String METHOD_UNBLOCK_PACKAGE = "unblock_package";
    field public static final int RESULT_ERROR_INVALID_ARGUMENT = 2; // 0x2
    field public static final int RESULT_ERROR_IO = 1; // 0x1
    field public static final int RESULT_OK = 0; // 0x0
  }

  public static final class TvContract.WatchedPrograms implements android.media.tv.TvContract.BaseTvColumns {
    field public static final String COLUMN_CHANNEL_ID = "channel_id";
    field public static final String COLUMN_DESCRIPTION = "description";
    field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
    field public static final String COLUMN_INTERNAL_SESSION_TOKEN = "session_token";
    field public static final String COLUMN_INTERNAL_TUNE_PARAMS = "tune_params";
    field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
    field public static final String COLUMN_TITLE = "title";
    field public static final String COLUMN_WATCH_END_TIME_UTC_MILLIS = "watch_end_time_utc_millis";
    field public static final String COLUMN_WATCH_START_TIME_UTC_MILLIS = "watch_start_time_utc_millis";
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/watched_program";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/watched_program";
    field public static final android.net.Uri CONTENT_URI;
  }

  public final class TvInputHardwareInfo implements android.os.Parcelable {
    method public int describeContents();
    method public String getAudioAddress();
    method public int getAudioType();
    method public int getCableConnectionStatus();
    method public int getDeviceId();
    method public int getHdmiPortId();
    method public int getType();
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CABLE_CONNECTION_STATUS_CONNECTED = 1; // 0x1
    field public static final int CABLE_CONNECTION_STATUS_DISCONNECTED = 2; // 0x2
    field public static final int CABLE_CONNECTION_STATUS_UNKNOWN = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.media.tv.TvInputHardwareInfo> CREATOR;
    field public static final int TV_INPUT_TYPE_COMPONENT = 6; // 0x6
    field public static final int TV_INPUT_TYPE_COMPOSITE = 3; // 0x3
    field public static final int TV_INPUT_TYPE_DISPLAY_PORT = 10; // 0xa
    field public static final int TV_INPUT_TYPE_DVI = 8; // 0x8
    field public static final int TV_INPUT_TYPE_HDMI = 9; // 0x9
    field public static final int TV_INPUT_TYPE_OTHER_HARDWARE = 1; // 0x1
    field public static final int TV_INPUT_TYPE_SCART = 5; // 0x5
    field public static final int TV_INPUT_TYPE_SVIDEO = 4; // 0x4
    field public static final int TV_INPUT_TYPE_TUNER = 2; // 0x2
    field public static final int TV_INPUT_TYPE_VGA = 7; // 0x7
  }

  public static final class TvInputHardwareInfo.Builder {
    ctor public TvInputHardwareInfo.Builder();
    method public android.media.tv.TvInputHardwareInfo.Builder audioAddress(String);
    method public android.media.tv.TvInputHardwareInfo.Builder audioType(int);
    method public android.media.tv.TvInputHardwareInfo build();
    method public android.media.tv.TvInputHardwareInfo.Builder cableConnectionStatus(int);
    method public android.media.tv.TvInputHardwareInfo.Builder deviceId(int);
    method public android.media.tv.TvInputHardwareInfo.Builder hdmiPortId(int);
    method public android.media.tv.TvInputHardwareInfo.Builder type(int);
  }

  public final class TvInputInfo implements android.os.Parcelable {
    method @Deprecated public static android.media.tv.TvInputInfo createTvInputInfo(android.content.Context, android.content.pm.ResolveInfo, android.hardware.hdmi.HdmiDeviceInfo, String, String, android.net.Uri) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method @Deprecated public static android.media.tv.TvInputInfo createTvInputInfo(android.content.Context, android.content.pm.ResolveInfo, android.hardware.hdmi.HdmiDeviceInfo, String, int, android.graphics.drawable.Icon) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method @Deprecated public static android.media.tv.TvInputInfo createTvInputInfo(android.content.Context, android.content.pm.ResolveInfo, android.media.tv.TvInputHardwareInfo, String, android.net.Uri) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method @Deprecated public static android.media.tv.TvInputInfo createTvInputInfo(android.content.Context, android.content.pm.ResolveInfo, android.media.tv.TvInputHardwareInfo, int, android.graphics.drawable.Icon) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public android.hardware.hdmi.HdmiDeviceInfo getHdmiDeviceInfo();
    method public boolean isConnectedToHdmiSwitch();
    method public boolean isHardwareInput();
    method public android.graphics.drawable.Drawable loadIcon(@NonNull android.content.Context, int);
  }

  public static final class TvInputInfo.Builder {
    method public android.media.tv.TvInputInfo.Builder setHdmiDeviceInfo(android.hardware.hdmi.HdmiDeviceInfo);
    method public android.media.tv.TvInputInfo.Builder setIcon(android.graphics.drawable.Icon);
    method public android.media.tv.TvInputInfo.Builder setIcon(android.graphics.drawable.Icon, int);
    method public android.media.tv.TvInputInfo.Builder setLabel(CharSequence);
    method public android.media.tv.TvInputInfo.Builder setLabel(@StringRes int);
    method public android.media.tv.TvInputInfo.Builder setParentId(String);
    method public android.media.tv.TvInputInfo.Builder setTvInputHardwareInfo(android.media.tv.TvInputHardwareInfo);
  }

  public static final class TvInputInfo.TvInputSettings {
    method public static java.util.Map<java.lang.String,java.lang.String> getCustomLabels(android.content.Context, int);
    method public static java.util.Set<java.lang.String> getHiddenTvInputIds(android.content.Context, int);
    method public static void putCustomLabels(android.content.Context, java.util.Map<java.lang.String,java.lang.String>, int);
    method public static void putHiddenTvInputs(android.content.Context, java.util.Set<java.lang.String>, int);
  }

  public final class TvInputManager {
    method @RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE) public android.media.tv.TvInputManager.Hardware acquireTvInputHardware(int, android.media.tv.TvInputInfo, android.media.tv.TvInputManager.HardwareCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void addBlockedRating(@NonNull android.media.tv.TvContentRating);
    method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public boolean captureFrame(String, android.view.Surface, android.media.tv.TvStreamConfig);
    method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public java.util.List<android.media.tv.TvStreamConfig> getAvailableTvStreamConfigList(String);
    method @RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE) public java.util.List<android.media.tv.TvInputHardwareInfo> getHardwareList();
    method @RequiresPermission(android.Manifest.permission.READ_CONTENT_RATING_SYSTEMS) public java.util.List<android.media.tv.TvContentRatingSystemInfo> getTvContentRatingSystemList();
    method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public boolean isSingleSessionActive();
    method @RequiresPermission(android.Manifest.permission.NOTIFY_TV_INPUTS) public void notifyPreviewProgramAddedToWatchNext(String, long, long);
    method @RequiresPermission(android.Manifest.permission.NOTIFY_TV_INPUTS) public void notifyPreviewProgramBrowsableDisabled(String, long);
    method @RequiresPermission(android.Manifest.permission.NOTIFY_TV_INPUTS) public void notifyWatchNextProgramBrowsableDisabled(String, long);
    method @RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE) public void releaseTvInputHardware(int, android.media.tv.TvInputManager.Hardware);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void removeBlockedRating(@NonNull android.media.tv.TvContentRating);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void setParentalControlsEnabled(boolean);
  }

  public static final class TvInputManager.Hardware {
    method public void overrideAudioSink(int, String, int, int, int);
    method public void setStreamVolume(float);
    method public boolean setSurface(android.view.Surface, android.media.tv.TvStreamConfig);
  }

  public abstract static class TvInputManager.HardwareCallback {
    ctor public TvInputManager.HardwareCallback();
    method public abstract void onReleased();
    method public abstract void onStreamConfigChanged(android.media.tv.TvStreamConfig[]);
  }

  public abstract class TvInputService extends android.app.Service {
    method @Nullable public android.media.tv.TvInputInfo onHardwareAdded(android.media.tv.TvInputHardwareInfo);
    method @Nullable public String onHardwareRemoved(android.media.tv.TvInputHardwareInfo);
    method @Nullable public android.media.tv.TvInputInfo onHdmiDeviceAdded(android.hardware.hdmi.HdmiDeviceInfo);
    method @Nullable public String onHdmiDeviceRemoved(android.hardware.hdmi.HdmiDeviceInfo);
  }

  public abstract static class TvInputService.RecordingSession {
    method public void notifySessionEvent(@NonNull String, android.os.Bundle);
  }

  public abstract static class TvInputService.Session implements android.view.KeyEvent.Callback {
    method public void notifySessionEvent(@NonNull String, android.os.Bundle);
    method public void onSetMain(boolean);
  }

  public abstract static class TvRecordingClient.RecordingCallback {
    method public void onEvent(String, String, android.os.Bundle);
  }

  public class TvStreamConfig implements android.os.Parcelable {
    method public int describeContents();
    method public int getGeneration();
    method public int getMaxHeight();
    method public int getMaxWidth();
    method public int getStreamId();
    method public int getType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.tv.TvStreamConfig> CREATOR;
    field public static final int STREAM_TYPE_BUFFER_PRODUCER = 2; // 0x2
    field public static final int STREAM_TYPE_INDEPENDENT_VIDEO_SOURCE = 1; // 0x1
  }

  public static final class TvStreamConfig.Builder {
    ctor public TvStreamConfig.Builder();
    method public android.media.tv.TvStreamConfig build();
    method public android.media.tv.TvStreamConfig.Builder generation(int);
    method public android.media.tv.TvStreamConfig.Builder maxHeight(int);
    method public android.media.tv.TvStreamConfig.Builder maxWidth(int);
    method public android.media.tv.TvStreamConfig.Builder streamId(int);
    method public android.media.tv.TvStreamConfig.Builder type(int);
  }

  public class TvView extends android.view.ViewGroup {
    method @RequiresPermission("android.permission.CHANGE_HDMI_CEC_ACTIVE_SOURCE") public void setMain();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void unblockContent(android.media.tv.TvContentRating);
  }

  public abstract static class TvView.TvInputCallback {
    method public void onEvent(String, String, android.os.Bundle);
  }

}

package android.metrics {

  public class LogMaker {
    ctor public LogMaker(int);
    ctor public LogMaker(Object[]);
    method public android.metrics.LogMaker addTaggedData(int, Object);
    method public android.metrics.LogMaker clearCategory();
    method public android.metrics.LogMaker clearPackageName();
    method public android.metrics.LogMaker clearSubtype();
    method public android.metrics.LogMaker clearTaggedData(int);
    method public android.metrics.LogMaker clearType();
    method public void deserialize(Object[]);
    method public int getCategory();
    method public long getCounterBucket();
    method public String getCounterName();
    method public int getCounterValue();
    method public String getPackageName();
    method public int getProcessId();
    method public int getSubtype();
    method public Object getTaggedData(int);
    method public long getTimestamp();
    method public int getType();
    method public int getUid();
    method public boolean isLongCounterBucket();
    method public boolean isSubsetOf(android.metrics.LogMaker);
    method public boolean isValidValue(Object);
    method public Object[] serialize();
    method public android.metrics.LogMaker setCategory(int);
    method public android.metrics.LogMaker setPackageName(String);
    method public android.metrics.LogMaker setSubtype(int);
    method public android.metrics.LogMaker setType(int);
  }

  public class MetricsReader {
    ctor public MetricsReader();
    method public void checkpoint();
    method public boolean hasNext();
    method public android.metrics.LogMaker next();
    method public void read(long);
    method public void reset();
  }

}

package android.net {

  public class CaptivePortal implements android.os.Parcelable {
    ctor public CaptivePortal(android.os.IBinder);
    method public void logEvent(int, String);
    method public void useNetwork();
    field public static final int APP_RETURN_DISMISSED = 0; // 0x0
    field public static final int APP_RETURN_UNWANTED = 1; // 0x1
    field public static final int APP_RETURN_WANTED_AS_IS = 2; // 0x2
  }

  public class ConnectivityManager {
    method @RequiresPermission(android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD) public android.net.SocketKeepalive createNattKeepalive(@NonNull android.net.Network, @NonNull java.io.FileDescriptor, @NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback);
    method @RequiresPermission(android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD) public android.net.SocketKeepalive createSocketKeepalive(@NonNull android.net.Network, @NonNull java.net.Socket, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback);
    method public boolean getAvoidBadWifi();
    method @RequiresPermission(android.Manifest.permission.LOCAL_MAC_ADDRESS) public String getCaptivePortalServerUrl();
    method @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void getLatestTetheringEntitlementValue(int, boolean, @NonNull android.net.ConnectivityManager.TetheringEntitlementValueListener, @Nullable android.os.Handler);
    method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public boolean isTetheringSupported();
    method @RequiresPermission(anyOf={"android.permission.NETWORK_SETTINGS", android.Manifest.permission.NETWORK_SETUP_WIZARD, "android.permission.NETWORK_STACK"}) public void setAirplaneMode(boolean);
    method @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public void startCaptivePortalApp(android.net.Network, android.os.Bundle);
    method @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int, boolean, android.net.ConnectivityManager.OnStartTetheringCallback);
    method @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int, boolean, android.net.ConnectivityManager.OnStartTetheringCallback, android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void stopTethering(int);
    field public static final String EXTRA_CAPTIVE_PORTAL_PROBE_SPEC = "android.net.extra.CAPTIVE_PORTAL_PROBE_SPEC";
    field public static final String EXTRA_CAPTIVE_PORTAL_USER_AGENT = "android.net.extra.CAPTIVE_PORTAL_USER_AGENT";
    field public static final int TETHERING_BLUETOOTH = 2; // 0x2
    field public static final int TETHERING_USB = 1; // 0x1
    field public static final int TETHERING_WIFI = 0; // 0x0
    field public static final int TETHER_ERROR_ENTITLEMENT_UNKONWN = 13; // 0xd
    field public static final int TETHER_ERROR_NO_ERROR = 0; // 0x0
    field public static final int TETHER_ERROR_PROVISION_FAILED = 11; // 0xb
  }

  public abstract static class ConnectivityManager.OnStartTetheringCallback {
    ctor public ConnectivityManager.OnStartTetheringCallback();
    method public void onTetheringFailed();
    method public void onTetheringStarted();
  }

  public abstract static class ConnectivityManager.TetheringEntitlementValueListener {
    ctor public ConnectivityManager.TetheringEntitlementValueListener();
    method public void onEntitlementResult(int);
  }

  public final class IpPrefix implements android.os.Parcelable {
    ctor public IpPrefix(java.net.InetAddress, int);
    ctor public IpPrefix(String);
  }

  public class LinkAddress implements android.os.Parcelable {
    ctor public LinkAddress(java.net.InetAddress, int, int, int);
    ctor public LinkAddress(@NonNull java.net.InetAddress, int);
    ctor public LinkAddress(@NonNull String);
    ctor public LinkAddress(String, int, int);
    method public boolean isGlobalPreferred();
    method public boolean isIPv4();
    method public boolean isIPv6();
    method public boolean isSameAddressAs(android.net.LinkAddress);
  }

  public final class LinkProperties implements android.os.Parcelable {
    ctor public LinkProperties();
    ctor public LinkProperties(android.net.LinkProperties);
    method public boolean addDnsServer(java.net.InetAddress);
    method public boolean addLinkAddress(android.net.LinkAddress);
    method public boolean addRoute(android.net.RouteInfo);
    method public void clear();
    method @Nullable public android.net.IpPrefix getNat64Prefix();
    method public java.util.List<java.net.InetAddress> getPcscfServers();
    method public String getTcpBufferSizes();
    method public java.util.List<java.net.InetAddress> getValidatedPrivateDnsServers();
    method public boolean hasGlobalIPv6Address();
    method public boolean hasIPv4Address();
    method public boolean hasIPv6DefaultRoute();
    method public boolean isIPv4Provisioned();
    method public boolean isIPv6Provisioned();
    method public boolean isProvisioned();
    method public boolean isReachable(java.net.InetAddress);
    method public boolean removeDnsServer(java.net.InetAddress);
    method public boolean removeLinkAddress(android.net.LinkAddress);
    method public boolean removeRoute(android.net.RouteInfo);
    method public void setDnsServers(java.util.Collection<java.net.InetAddress>);
    method public void setDomains(String);
    method public void setHttpProxy(android.net.ProxyInfo);
    method public void setInterfaceName(String);
    method public void setLinkAddresses(java.util.Collection<android.net.LinkAddress>);
    method public void setMtu(int);
    method public void setNat64Prefix(android.net.IpPrefix);
    method public void setPcscfServers(java.util.Collection<java.net.InetAddress>);
    method public void setPrivateDnsServerName(@Nullable String);
    method public void setTcpBufferSizes(String);
    method public void setUsePrivateDns(boolean);
    method public void setValidatedPrivateDnsServers(java.util.Collection<java.net.InetAddress>);
  }

  public class Network implements android.os.Parcelable {
    ctor public Network(android.net.Network);
    method public android.net.Network getPrivateDnsBypassingCopy();
  }

  public final class NetworkCapabilities implements android.os.Parcelable {
    method public int getSignalStrength();
    method public int[] getTransportTypes();
    method public boolean satisfiedByNetworkCapabilities(android.net.NetworkCapabilities);
    field public static final int NET_CAPABILITY_OEM_PAID = 22; // 0x16
  }

  public class NetworkKey implements android.os.Parcelable {
    ctor public NetworkKey(android.net.WifiKey);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.NetworkKey> CREATOR;
    field public static final int TYPE_WIFI = 1; // 0x1
    field public final int type;
    field public final android.net.WifiKey wifiKey;
  }

  public abstract class NetworkRecommendationProvider {
    ctor public NetworkRecommendationProvider(android.content.Context, java.util.concurrent.Executor);
    method public final android.os.IBinder getBinder();
    method public abstract void onRequestScores(android.net.NetworkKey[]);
  }

  public static class NetworkRequest.Builder {
    method public android.net.NetworkRequest.Builder setSignalStrength(int);
  }

  public class NetworkScoreManager {
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, "android.permission.REQUEST_NETWORK_SCORES"}) public boolean clearScores() throws java.lang.SecurityException;
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, "android.permission.REQUEST_NETWORK_SCORES"}) public void disableScoring() throws java.lang.SecurityException;
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, "android.permission.REQUEST_NETWORK_SCORES"}) public String getActiveScorerPackage();
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, "android.permission.REQUEST_NETWORK_SCORES"}) public boolean setActiveScorer(String) throws java.lang.SecurityException;
    method @RequiresPermission(android.Manifest.permission.SCORE_NETWORKS) public boolean updateScores(android.net.ScoredNetwork[]) throws java.lang.SecurityException;
    field public static final String ACTION_CHANGE_ACTIVE = "android.net.scoring.CHANGE_ACTIVE";
    field public static final String ACTION_CUSTOM_ENABLE = "android.net.scoring.CUSTOM_ENABLE";
    field public static final String ACTION_RECOMMEND_NETWORKS = "android.net.action.RECOMMEND_NETWORKS";
    field public static final String ACTION_SCORER_CHANGED = "android.net.scoring.SCORER_CHANGED";
    field public static final String ACTION_SCORE_NETWORKS = "android.net.scoring.SCORE_NETWORKS";
    field public static final String EXTRA_NETWORKS_TO_SCORE = "networksToScore";
    field public static final String EXTRA_NEW_SCORER = "newScorer";
    field public static final String EXTRA_PACKAGE_NAME = "packageName";
  }

  public class NetworkStack {
    field public static final String PERMISSION_MAINLINE_NETWORK_STACK = "android.permission.MAINLINE_NETWORK_STACK";
  }

  public final class RouteInfo implements android.os.Parcelable {
    ctor public RouteInfo(android.net.IpPrefix, java.net.InetAddress, String, int);
    method public int getType();
    field public static final int RTN_THROW = 9; // 0x9
    field public static final int RTN_UNICAST = 1; // 0x1
    field public static final int RTN_UNREACHABLE = 7; // 0x7
  }

  public class RssiCurve implements android.os.Parcelable {
    ctor public RssiCurve(int, int, byte[]);
    ctor public RssiCurve(int, int, byte[], int);
    method public int describeContents();
    method public byte lookupScore(int);
    method public byte lookupScore(int, boolean);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.RssiCurve> CREATOR;
    field public final int activeNetworkRssiBoost;
    field public final int bucketWidth;
    field public final byte[] rssiBuckets;
    field public final int start;
  }

  public class ScoredNetwork implements android.os.Parcelable {
    ctor public ScoredNetwork(android.net.NetworkKey, android.net.RssiCurve);
    ctor public ScoredNetwork(android.net.NetworkKey, android.net.RssiCurve, boolean);
    ctor public ScoredNetwork(android.net.NetworkKey, android.net.RssiCurve, boolean, @Nullable android.os.Bundle);
    method public int calculateBadge(int);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final String ATTRIBUTES_KEY_BADGING_CURVE = "android.net.attributes.key.BADGING_CURVE";
    field public static final String ATTRIBUTES_KEY_HAS_CAPTIVE_PORTAL = "android.net.attributes.key.HAS_CAPTIVE_PORTAL";
    field public static final String ATTRIBUTES_KEY_RANKING_SCORE_OFFSET = "android.net.attributes.key.RANKING_SCORE_OFFSET";
    field public static final android.os.Parcelable.Creator<android.net.ScoredNetwork> CREATOR;
    field @Nullable public final android.os.Bundle attributes;
    field public final boolean meteredHint;
    field public final android.net.NetworkKey networkKey;
    field public final android.net.RssiCurve rssiCurve;
  }

  public final class StaticIpConfiguration implements android.os.Parcelable {
    ctor public StaticIpConfiguration();
    ctor public StaticIpConfiguration(android.net.StaticIpConfiguration);
    method public void addDnsServer(java.net.InetAddress);
    method public void clear();
    method public int describeContents();
    method public java.util.List<java.net.InetAddress> getDnsServers();
    method public String getDomains();
    method public java.net.InetAddress getGateway();
    method public android.net.LinkAddress getIpAddress();
    method public java.util.List<android.net.RouteInfo> getRoutes(String);
    method public void setDomains(String);
    method public void setGateway(java.net.InetAddress);
    method public void setIpAddress(android.net.LinkAddress);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.StaticIpConfiguration> CREATOR;
  }

  public class TrafficStats {
    method public static void setThreadStatsTagApp();
    method public static void setThreadStatsTagBackup();
    method public static void setThreadStatsTagRestore();
    field public static final int TAG_SYSTEM_DHCP = -192; // 0xffffff40
    field public static final int TAG_SYSTEM_DHCP_SERVER = -186; // 0xffffff46
    field public static final int TAG_SYSTEM_PROBE = -190; // 0xffffff42
  }

  public class VpnService extends android.app.Service {
    method @RequiresPermission(android.Manifest.permission.CONTROL_VPN) public static void prepareAndAuthorize(android.content.Context);
  }

  public class WebAddress {
    ctor public WebAddress(String) throws android.net.ParseException;
  }

  public class WifiKey implements android.os.Parcelable {
    ctor public WifiKey(String, String);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.WifiKey> CREATOR;
    field public final String bssid;
    field public final String ssid;
  }

}

package android.net.apf {

  public class ApfCapabilities {
    ctor public ApfCapabilities(int, int, int);
    method public static boolean getApfDrop8023Frames(android.content.Context);
    method public static int[] getApfEthTypeBlackList(android.content.Context);
    method public boolean hasDataAccess();
    field public final int apfPacketFormat;
    field public final int apfVersionSupported;
    field public final int maximumApfProgramSize;
  }

}

package android.net.captiveportal {

  public final class CaptivePortalProbeResult {
    ctor public CaptivePortalProbeResult(int);
    ctor public CaptivePortalProbeResult(int, String, String);
    ctor public CaptivePortalProbeResult(int, String, String, android.net.captiveportal.CaptivePortalProbeSpec);
    method public boolean isFailed();
    method public boolean isPortal();
    method public boolean isSuccessful();
    field public static final android.net.captiveportal.CaptivePortalProbeResult FAILED;
    field public static final int FAILED_CODE = 599; // 0x257
    field public static final int PORTAL_CODE = 302; // 0x12e
    field public static final android.net.captiveportal.CaptivePortalProbeResult SUCCESS;
    field public static final int SUCCESS_CODE = 204; // 0xcc
    field public final String detectUrl;
    field @Nullable public final android.net.captiveportal.CaptivePortalProbeSpec probeSpec;
    field public final String redirectUrl;
  }

  public abstract class CaptivePortalProbeSpec {
    method public String getEncodedSpec();
    method public abstract android.net.captiveportal.CaptivePortalProbeResult getResult(int, @Nullable String);
    method public java.net.URL getUrl();
    method public static java.util.Collection<android.net.captiveportal.CaptivePortalProbeSpec> parseCaptivePortalProbeSpecs(String);
    method @Nullable public static android.net.captiveportal.CaptivePortalProbeSpec parseSpecOrNull(@Nullable String);
  }

}

package android.net.metrics {

  public final class ApfProgramEvent implements android.net.metrics.IpConnectivityLog.Event {
  }

  public static class ApfProgramEvent.Builder {
    ctor public ApfProgramEvent.Builder();
    method public android.net.metrics.ApfProgramEvent build();
    method public android.net.metrics.ApfProgramEvent.Builder setActualLifetime(long);
    method public android.net.metrics.ApfProgramEvent.Builder setCurrentRas(int);
    method public android.net.metrics.ApfProgramEvent.Builder setFilteredRas(int);
    method public android.net.metrics.ApfProgramEvent.Builder setFlags(boolean, boolean);
    method public android.net.metrics.ApfProgramEvent.Builder setLifetime(long);
    method public android.net.metrics.ApfProgramEvent.Builder setProgramLength(int);
  }

  public final class ApfStats implements android.net.metrics.IpConnectivityLog.Event {
  }

  public static class ApfStats.Builder {
    ctor public ApfStats.Builder();
    method public android.net.metrics.ApfStats build();
    method public android.net.metrics.ApfStats.Builder setDroppedRas(int);
    method public android.net.metrics.ApfStats.Builder setDurationMs(long);
    method public android.net.metrics.ApfStats.Builder setMatchingRas(int);
    method public android.net.metrics.ApfStats.Builder setMaxProgramSize(int);
    method public android.net.metrics.ApfStats.Builder setParseErrors(int);
    method public android.net.metrics.ApfStats.Builder setProgramUpdates(int);
    method public android.net.metrics.ApfStats.Builder setProgramUpdatesAll(int);
    method public android.net.metrics.ApfStats.Builder setProgramUpdatesAllowingMulticast(int);
    method public android.net.metrics.ApfStats.Builder setReceivedRas(int);
    method public android.net.metrics.ApfStats.Builder setZeroLifetimeRas(int);
  }

  public final class DhcpClientEvent implements android.net.metrics.IpConnectivityLog.Event {
  }

  public static class DhcpClientEvent.Builder {
    ctor public DhcpClientEvent.Builder();
    method public android.net.metrics.DhcpClientEvent build();
    method public android.net.metrics.DhcpClientEvent.Builder setDurationMs(int);
    method public android.net.metrics.DhcpClientEvent.Builder setMsg(String);
  }

  public final class DhcpErrorEvent implements android.net.metrics.IpConnectivityLog.Event {
    ctor public DhcpErrorEvent(int);
    method public static int errorCodeWithOption(int, int);
    field public static final int BOOTP_TOO_SHORT;
    field public static final int BUFFER_UNDERFLOW;
    field public static final int DHCP_BAD_MAGIC_COOKIE;
    field public static final int DHCP_ERROR = 4; // 0x4
    field public static final int DHCP_INVALID_OPTION_LENGTH;
    field public static final int DHCP_NO_COOKIE;
    field public static final int DHCP_NO_MSG_TYPE;
    field public static final int DHCP_UNKNOWN_MSG_TYPE;
    field public static final int L2_ERROR = 1; // 0x1
    field public static final int L2_TOO_SHORT;
    field public static final int L2_WRONG_ETH_TYPE;
    field public static final int L3_ERROR = 2; // 0x2
    field public static final int L3_INVALID_IP;
    field public static final int L3_NOT_IPV4;
    field public static final int L3_TOO_SHORT;
    field public static final int L4_ERROR = 3; // 0x3
    field public static final int L4_NOT_UDP;
    field public static final int L4_WRONG_PORT;
    field public static final int MISC_ERROR = 5; // 0x5
    field public static final int PARSING_ERROR;
    field public static final int RECEIVE_ERROR;
  }

  public class IpConnectivityLog {
    ctor public IpConnectivityLog();
    method public boolean log(long, android.net.metrics.IpConnectivityLog.Event);
    method public boolean log(String, android.net.metrics.IpConnectivityLog.Event);
    method public boolean log(android.net.Network, int[], android.net.metrics.IpConnectivityLog.Event);
    method public boolean log(int, int[], android.net.metrics.IpConnectivityLog.Event);
    method public boolean log(android.net.metrics.IpConnectivityLog.Event);
  }

  public static interface IpConnectivityLog.Event extends android.os.Parcelable {
  }

  public final class IpManagerEvent implements android.net.metrics.IpConnectivityLog.Event {
    ctor public IpManagerEvent(int, long);
    field public static final int COMPLETE_LIFECYCLE = 3; // 0x3
    field public static final int ERROR_INTERFACE_NOT_FOUND = 8; // 0x8
    field public static final int ERROR_INVALID_PROVISIONING = 7; // 0x7
    field public static final int ERROR_STARTING_IPREACHABILITYMONITOR = 6; // 0x6
    field public static final int ERROR_STARTING_IPV4 = 4; // 0x4
    field public static final int ERROR_STARTING_IPV6 = 5; // 0x5
    field public static final int PROVISIONING_FAIL = 2; // 0x2
    field public static final int PROVISIONING_OK = 1; // 0x1
  }

  public final class IpReachabilityEvent implements android.net.metrics.IpConnectivityLog.Event {
    ctor public IpReachabilityEvent(int);
    field public static final int NUD_FAILED = 512; // 0x200
    field public static final int NUD_FAILED_ORGANIC = 1024; // 0x400
    field public static final int PROBE = 256; // 0x100
    field public static final int PROVISIONING_LOST = 768; // 0x300
    field public static final int PROVISIONING_LOST_ORGANIC = 1280; // 0x500
  }

  public final class NetworkEvent implements android.net.metrics.IpConnectivityLog.Event {
    ctor public NetworkEvent(int, long);
    ctor public NetworkEvent(int);
    field public static final int NETWORK_CAPTIVE_PORTAL_FOUND = 4; // 0x4
    field public static final int NETWORK_CONNECTED = 1; // 0x1
    field public static final int NETWORK_CONSECUTIVE_DNS_TIMEOUT_FOUND = 12; // 0xc
    field public static final int NETWORK_DISCONNECTED = 7; // 0x7
    field public static final int NETWORK_FIRST_VALIDATION_PORTAL_FOUND = 10; // 0xa
    field public static final int NETWORK_FIRST_VALIDATION_SUCCESS = 8; // 0x8
    field public static final int NETWORK_LINGER = 5; // 0x5
    field public static final int NETWORK_REVALIDATION_PORTAL_FOUND = 11; // 0xb
    field public static final int NETWORK_REVALIDATION_SUCCESS = 9; // 0x9
    field public static final int NETWORK_UNLINGER = 6; // 0x6
    field public static final int NETWORK_VALIDATED = 2; // 0x2
    field public static final int NETWORK_VALIDATION_FAILED = 3; // 0x3
  }

  public final class RaEvent implements android.net.metrics.IpConnectivityLog.Event {
  }

  public static class RaEvent.Builder {
    ctor public RaEvent.Builder();
    method public android.net.metrics.RaEvent build();
    method public android.net.metrics.RaEvent.Builder updateDnsslLifetime(long);
    method public android.net.metrics.RaEvent.Builder updatePrefixPreferredLifetime(long);
    method public android.net.metrics.RaEvent.Builder updatePrefixValidLifetime(long);
    method public android.net.metrics.RaEvent.Builder updateRdnssLifetime(long);
    method public android.net.metrics.RaEvent.Builder updateRouteInfoLifetime(long);
    method public android.net.metrics.RaEvent.Builder updateRouterLifetime(long);
  }

  public final class ValidationProbeEvent implements android.net.metrics.IpConnectivityLog.Event {
    method public static String getProbeName(int);
    field public static final int DNS_FAILURE = 0; // 0x0
    field public static final int DNS_SUCCESS = 1; // 0x1
    field public static final int PROBE_DNS = 0; // 0x0
    field public static final int PROBE_FALLBACK = 4; // 0x4
    field public static final int PROBE_HTTP = 1; // 0x1
    field public static final int PROBE_HTTPS = 2; // 0x2
    field public static final int PROBE_PAC = 3; // 0x3
    field public static final int PROBE_PRIVDNS = 5; // 0x5
  }

  public static class ValidationProbeEvent.Builder {
    ctor public ValidationProbeEvent.Builder();
    method public android.net.metrics.ValidationProbeEvent build();
    method public android.net.metrics.ValidationProbeEvent.Builder setDurationMs(long);
    method public android.net.metrics.ValidationProbeEvent.Builder setProbeType(int, boolean);
    method public android.net.metrics.ValidationProbeEvent.Builder setReturnCode(int);
  }

}

package android.net.util {

  public class SocketUtils {
    method public static void addArpEntry(@NonNull java.net.Inet4Address, @NonNull android.net.MacAddress, @NonNull String, @NonNull java.io.FileDescriptor) throws java.io.IOException;
    method public static void attachControlPacketFilter(@NonNull java.io.FileDescriptor, int) throws java.net.SocketException;
    method public static void attachDhcpFilter(@NonNull java.io.FileDescriptor) throws java.net.SocketException;
    method public static void attachRaFilter(@NonNull java.io.FileDescriptor, int) throws java.net.SocketException;
    method public static void bindSocketToInterface(@NonNull java.io.FileDescriptor, @NonNull String) throws android.system.ErrnoException;
    method public static void closeSocket(@Nullable java.io.FileDescriptor) throws java.io.IOException;
    method public static java.net.SocketAddress makeNetlinkSocketAddress(int, int);
    method public static java.net.SocketAddress makePacketSocketAddress(short, int);
    method public static java.net.SocketAddress makePacketSocketAddress(int, @NonNull byte[]);
    method public static void setSocketTimeValueOption(@NonNull java.io.FileDescriptor, int, int, long) throws android.system.ErrnoException;
  }

}

package android.net.wifi {

  @Deprecated public class RttManager {
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void disableResponder(android.net.wifi.RttManager.ResponderCallback);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void enableResponder(android.net.wifi.RttManager.ResponderCallback);
    method @Deprecated public android.net.wifi.RttManager.Capabilities getCapabilities();
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.net.wifi.RttManager.RttCapabilities getRttCapabilities();
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startRanging(android.net.wifi.RttManager.RttParams[], android.net.wifi.RttManager.RttListener);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopRanging(android.net.wifi.RttManager.RttListener);
    field @Deprecated public static final int BASE = 160256; // 0x27200
    field @Deprecated public static final int CMD_OP_ABORTED = 160260; // 0x27204
    field @Deprecated public static final int CMD_OP_DISABLE_RESPONDER = 160262; // 0x27206
    field @Deprecated public static final int CMD_OP_ENABLE_RESPONDER = 160261; // 0x27205
    field @Deprecated public static final int CMD_OP_ENALBE_RESPONDER_FAILED = 160264; // 0x27208
    field @Deprecated public static final int CMD_OP_ENALBE_RESPONDER_SUCCEEDED = 160263; // 0x27207
    field @Deprecated public static final int CMD_OP_FAILED = 160258; // 0x27202
    field @Deprecated public static final int CMD_OP_START_RANGING = 160256; // 0x27200
    field @Deprecated public static final int CMD_OP_STOP_RANGING = 160257; // 0x27201
    field @Deprecated public static final int CMD_OP_SUCCEEDED = 160259; // 0x27203
    field @Deprecated public static final String DESCRIPTION_KEY = "android.net.wifi.RttManager.Description";
    field @Deprecated public static final int PREAMBLE_HT = 2; // 0x2
    field @Deprecated public static final int PREAMBLE_LEGACY = 1; // 0x1
    field @Deprecated public static final int PREAMBLE_VHT = 4; // 0x4
    field @Deprecated public static final int REASON_INITIATOR_NOT_ALLOWED_WHEN_RESPONDER_ON = -6; // 0xfffffffa
    field @Deprecated public static final int REASON_INVALID_LISTENER = -3; // 0xfffffffd
    field @Deprecated public static final int REASON_INVALID_REQUEST = -4; // 0xfffffffc
    field @Deprecated public static final int REASON_NOT_AVAILABLE = -2; // 0xfffffffe
    field @Deprecated public static final int REASON_PERMISSION_DENIED = -5; // 0xfffffffb
    field @Deprecated public static final int REASON_UNSPECIFIED = -1; // 0xffffffff
    field @Deprecated public static final int RTT_BW_10_SUPPORT = 2; // 0x2
    field @Deprecated public static final int RTT_BW_160_SUPPORT = 32; // 0x20
    field @Deprecated public static final int RTT_BW_20_SUPPORT = 4; // 0x4
    field @Deprecated public static final int RTT_BW_40_SUPPORT = 8; // 0x8
    field @Deprecated public static final int RTT_BW_5_SUPPORT = 1; // 0x1
    field @Deprecated public static final int RTT_BW_80_SUPPORT = 16; // 0x10
    field @Deprecated public static final int RTT_CHANNEL_WIDTH_10 = 6; // 0x6
    field @Deprecated public static final int RTT_CHANNEL_WIDTH_160 = 3; // 0x3
    field @Deprecated public static final int RTT_CHANNEL_WIDTH_20 = 0; // 0x0
    field @Deprecated public static final int RTT_CHANNEL_WIDTH_40 = 1; // 0x1
    field @Deprecated public static final int RTT_CHANNEL_WIDTH_5 = 5; // 0x5
    field @Deprecated public static final int RTT_CHANNEL_WIDTH_80 = 2; // 0x2
    field @Deprecated public static final int RTT_CHANNEL_WIDTH_80P80 = 4; // 0x4
    field @Deprecated public static final int RTT_CHANNEL_WIDTH_UNSPECIFIED = -1; // 0xffffffff
    field @Deprecated public static final int RTT_PEER_NAN = 5; // 0x5
    field @Deprecated public static final int RTT_PEER_P2P_CLIENT = 4; // 0x4
    field @Deprecated public static final int RTT_PEER_P2P_GO = 3; // 0x3
    field @Deprecated public static final int RTT_PEER_TYPE_AP = 1; // 0x1
    field @Deprecated public static final int RTT_PEER_TYPE_STA = 2; // 0x2
    field @Deprecated public static final int RTT_PEER_TYPE_UNSPECIFIED = 0; // 0x0
    field @Deprecated public static final int RTT_STATUS_ABORTED = 8; // 0x8
    field @Deprecated public static final int RTT_STATUS_FAILURE = 1; // 0x1
    field @Deprecated public static final int RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL = 6; // 0x6
    field @Deprecated public static final int RTT_STATUS_FAIL_BUSY_TRY_LATER = 12; // 0xc
    field @Deprecated public static final int RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15; // 0xf
    field @Deprecated public static final int RTT_STATUS_FAIL_INVALID_TS = 9; // 0x9
    field @Deprecated public static final int RTT_STATUS_FAIL_NOT_SCHEDULED_YET = 4; // 0x4
    field @Deprecated public static final int RTT_STATUS_FAIL_NO_CAPABILITY = 7; // 0x7
    field @Deprecated public static final int RTT_STATUS_FAIL_NO_RSP = 2; // 0x2
    field @Deprecated public static final int RTT_STATUS_FAIL_PROTOCOL = 10; // 0xa
    field @Deprecated public static final int RTT_STATUS_FAIL_REJECTED = 3; // 0x3
    field @Deprecated public static final int RTT_STATUS_FAIL_SCHEDULE = 11; // 0xb
    field @Deprecated public static final int RTT_STATUS_FAIL_TM_TIMEOUT = 5; // 0x5
    field @Deprecated public static final int RTT_STATUS_INVALID_REQ = 13; // 0xd
    field @Deprecated public static final int RTT_STATUS_NO_WIFI = 14; // 0xe
    field @Deprecated public static final int RTT_STATUS_SUCCESS = 0; // 0x0
    field @Deprecated public static final int RTT_TYPE_11_MC = 4; // 0x4
    field @Deprecated public static final int RTT_TYPE_11_V = 2; // 0x2
    field @Deprecated public static final int RTT_TYPE_ONE_SIDED = 1; // 0x1
    field @Deprecated public static final int RTT_TYPE_TWO_SIDED = 2; // 0x2
    field @Deprecated public static final int RTT_TYPE_UNSPECIFIED = 0; // 0x0
  }

  @Deprecated public class RttManager.Capabilities {
    ctor @Deprecated public RttManager.Capabilities();
    field @Deprecated public int supportedPeerType;
    field @Deprecated public int supportedType;
  }

  @Deprecated public static class RttManager.ParcelableRttParams implements android.os.Parcelable {
    field @Deprecated @NonNull public android.net.wifi.RttManager.RttParams[] mParams;
  }

  @Deprecated public static class RttManager.ParcelableRttResults implements android.os.Parcelable {
    ctor @Deprecated public RttManager.ParcelableRttResults(android.net.wifi.RttManager.RttResult[]);
    field @Deprecated public android.net.wifi.RttManager.RttResult[] mResults;
  }

  @Deprecated public abstract static class RttManager.ResponderCallback {
    ctor @Deprecated public RttManager.ResponderCallback();
    method @Deprecated public abstract void onResponderEnableFailure(int);
    method @Deprecated public abstract void onResponderEnabled(android.net.wifi.RttManager.ResponderConfig);
  }

  @Deprecated public static class RttManager.ResponderConfig implements android.os.Parcelable {
    ctor @Deprecated public RttManager.ResponderConfig();
    method @Deprecated public int describeContents();
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final android.os.Parcelable.Creator<android.net.wifi.RttManager.ResponderConfig> CREATOR;
    field @Deprecated public int centerFreq0;
    field @Deprecated public int centerFreq1;
    field @Deprecated public int channelWidth;
    field @Deprecated public int frequency;
    field @Deprecated public String macAddress;
    field @Deprecated public int preamble;
  }

  @Deprecated public static class RttManager.RttCapabilities implements android.os.Parcelable {
    ctor @Deprecated public RttManager.RttCapabilities();
    field @Deprecated public int bwSupported;
    field @Deprecated public boolean lciSupported;
    field @Deprecated public boolean lcrSupported;
    field @Deprecated public int mcVersion;
    field @Deprecated public boolean oneSidedRttSupported;
    field @Deprecated public int preambleSupported;
    field @Deprecated public boolean responderSupported;
    field @Deprecated public boolean secureRttSupported;
    field @Deprecated public boolean supportedPeerType;
    field @Deprecated public boolean supportedType;
    field @Deprecated public boolean twoSided11McRttSupported;
  }

  @Deprecated public static interface RttManager.RttListener {
    method @Deprecated public void onAborted();
    method @Deprecated public void onFailure(int, String);
    method @Deprecated public void onSuccess(android.net.wifi.RttManager.RttResult[]);
  }

  @Deprecated public static class RttManager.RttParams {
    ctor @Deprecated public RttManager.RttParams();
    field @Deprecated public boolean LCIRequest;
    field @Deprecated public boolean LCRRequest;
    field @Deprecated public int bandwidth;
    field @Deprecated public String bssid;
    field @Deprecated public int burstTimeout;
    field @Deprecated public int centerFreq0;
    field @Deprecated public int centerFreq1;
    field @Deprecated public int channelWidth;
    field @Deprecated public int deviceType;
    field @Deprecated public int frequency;
    field @Deprecated public int interval;
    field @Deprecated public int numRetriesPerFTMR;
    field @Deprecated public int numRetriesPerMeasurementFrame;
    field @Deprecated public int numSamplesPerBurst;
    field @Deprecated public int num_retries;
    field @Deprecated public int num_samples;
    field @Deprecated public int numberBurst;
    field @Deprecated public int preamble;
    field @Deprecated public int requestType;
    field @Deprecated public boolean secure;
  }

  @Deprecated public static class RttManager.RttResult {
    ctor @Deprecated public RttManager.RttResult();
    field @Deprecated public android.net.wifi.RttManager.WifiInformationElement LCI;
    field @Deprecated public android.net.wifi.RttManager.WifiInformationElement LCR;
    field @Deprecated public String bssid;
    field @Deprecated public int burstDuration;
    field @Deprecated public int burstNumber;
    field @Deprecated public int distance;
    field @Deprecated public int distanceSpread;
    field @Deprecated public int distanceStandardDeviation;
    field @Deprecated public int distance_cm;
    field @Deprecated public int distance_sd_cm;
    field @Deprecated public int distance_spread_cm;
    field @Deprecated public int frameNumberPerBurstPeer;
    field @Deprecated public int measurementFrameNumber;
    field @Deprecated public int measurementType;
    field @Deprecated public int negotiatedBurstNum;
    field @Deprecated public int requestType;
    field @Deprecated public int retryAfterDuration;
    field @Deprecated public int rssi;
    field @Deprecated public int rssiSpread;
    field @Deprecated public int rssi_spread;
    field @Deprecated public long rtt;
    field @Deprecated public long rttSpread;
    field @Deprecated public long rttStandardDeviation;
    field @Deprecated public long rtt_ns;
    field @Deprecated public long rtt_sd_ns;
    field @Deprecated public long rtt_spread_ns;
    field @Deprecated public int rxRate;
    field @Deprecated public boolean secure;
    field @Deprecated public int status;
    field @Deprecated public int successMeasurementFrameNumber;
    field @Deprecated public long ts;
    field @Deprecated public int txRate;
    field @Deprecated public int tx_rate;
  }

  @Deprecated public static class RttManager.WifiInformationElement {
    ctor @Deprecated public RttManager.WifiInformationElement();
    field @Deprecated public byte[] data;
    field @Deprecated public byte id;
  }

  public class WifiConfiguration implements android.os.Parcelable {
    method public boolean hasNoInternetAccess();
    method public boolean isEphemeral();
    method public boolean isNoInternetAccessExpected();
    field public String creatorName;
    field public int creatorUid;
    field public String lastUpdateName;
    field public int lastUpdateUid;
    field public boolean meteredHint;
    field public int numAssociation;
    field public int numScorerOverride;
    field public int numScorerOverrideAndSwitchedNetwork;
    field public boolean useExternalScores;
  }

  public static class WifiConfiguration.KeyMgmt {
    field public static final int WPA2_PSK = 4; // 0x4
  }

  public class WifiManager {
    method public void connect(android.net.wifi.WifiConfiguration, android.net.wifi.WifiManager.ActionListener);
    method @RequiresPermission(android.Manifest.permission.READ_WIFI_CREDENTIAL) public java.util.List<android.net.wifi.WifiConfiguration> getPrivilegedConfiguredNetworks();
    method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public android.net.wifi.WifiConfiguration getWifiApConfiguration();
    method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public int getWifiApState();
    method public boolean isDeviceToDeviceRttSupported();
    method public boolean isPortableHotspotSupported();
    method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public boolean isWifiApEnabled();
    method public boolean isWifiScannerSupported();
    method @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE) public boolean setWifiApConfiguration(android.net.wifi.WifiConfiguration);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public boolean startScan(android.os.WorkSource);
    field public static final int CHANGE_REASON_ADDED = 0; // 0x0
    field public static final int CHANGE_REASON_CONFIG_CHANGE = 2; // 0x2
    field public static final int CHANGE_REASON_REMOVED = 1; // 0x1
    field public static final String CONFIGURED_NETWORKS_CHANGED_ACTION = "android.net.wifi.CONFIGURED_NETWORKS_CHANGE";
    field public static final String EXTRA_CHANGE_REASON = "changeReason";
    field public static final String EXTRA_MULTIPLE_NETWORKS_CHANGED = "multipleChanges";
    field public static final String EXTRA_PREVIOUS_WIFI_AP_STATE = "previous_wifi_state";
    field public static final String EXTRA_WIFI_AP_STATE = "wifi_state";
    field public static final String EXTRA_WIFI_CONFIGURATION = "wifiConfiguration";
    field public static final String EXTRA_WIFI_CREDENTIAL_EVENT_TYPE = "et";
    field public static final String EXTRA_WIFI_CREDENTIAL_SSID = "ssid";
    field public static final String WIFI_AP_STATE_CHANGED_ACTION = "android.net.wifi.WIFI_AP_STATE_CHANGED";
    field public static final int WIFI_AP_STATE_DISABLED = 11; // 0xb
    field public static final int WIFI_AP_STATE_DISABLING = 10; // 0xa
    field public static final int WIFI_AP_STATE_ENABLED = 13; // 0xd
    field public static final int WIFI_AP_STATE_ENABLING = 12; // 0xc
    field public static final int WIFI_AP_STATE_FAILED = 14; // 0xe
    field public static final String WIFI_CREDENTIAL_CHANGED_ACTION = "android.net.wifi.WIFI_CREDENTIAL_CHANGED";
    field public static final int WIFI_CREDENTIAL_FORGOT = 1; // 0x1
    field public static final int WIFI_CREDENTIAL_SAVED = 0; // 0x0
  }

  public static interface WifiManager.ActionListener {
    method public void onFailure(int);
    method public void onSuccess();
  }

  public class WifiNetworkConnectionStatistics implements android.os.Parcelable {
    ctor public WifiNetworkConnectionStatistics(int, int);
    ctor public WifiNetworkConnectionStatistics();
    ctor public WifiNetworkConnectionStatistics(android.net.wifi.WifiNetworkConnectionStatistics);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.wifi.WifiNetworkConnectionStatistics> CREATOR;
    field public int numConnection;
    field public int numUsage;
  }

  public class WifiScanner {
    method @Deprecated public void configureWifiChange(int, int, int, int, int, android.net.wifi.WifiScanner.BssidInfo[]);
    method @Deprecated public void configureWifiChange(android.net.wifi.WifiScanner.WifiChangeSettings);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean getScanResults();
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
    method @Deprecated public void startTrackingBssids(android.net.wifi.WifiScanner.BssidInfo[], int, android.net.wifi.WifiScanner.BssidListener);
    method @Deprecated public void startTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopBackgroundScan(android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopScan(android.net.wifi.WifiScanner.ScanListener);
    method @Deprecated public void stopTrackingBssids(android.net.wifi.WifiScanner.BssidListener);
    method @Deprecated public void stopTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
    field public static final int MAX_SCAN_PERIOD_MS = 1024000; // 0xfa000
    field public static final int MIN_SCAN_PERIOD_MS = 1000; // 0x3e8
    field public static final int REASON_DUPLICATE_REQEUST = -5; // 0xfffffffb
    field public static final int REASON_INVALID_LISTENER = -2; // 0xfffffffe
    field public static final int REASON_INVALID_REQUEST = -3; // 0xfffffffd
    field public static final int REASON_NOT_AUTHORIZED = -4; // 0xfffffffc
    field public static final int REASON_SUCCEEDED = 0; // 0x0
    field public static final int REASON_UNSPECIFIED = -1; // 0xffffffff
    field @Deprecated public static final int REPORT_EVENT_AFTER_BUFFER_FULL = 0; // 0x0
    field public static final int REPORT_EVENT_AFTER_EACH_SCAN = 1; // 0x1
    field public static final int REPORT_EVENT_FULL_SCAN_RESULT = 2; // 0x2
    field public static final int REPORT_EVENT_NO_BATCH = 4; // 0x4
    field public static final int WIFI_BAND_24_GHZ = 1; // 0x1
    field public static final int WIFI_BAND_5_GHZ = 2; // 0x2
    field public static final int WIFI_BAND_5_GHZ_DFS_ONLY = 4; // 0x4
    field public static final int WIFI_BAND_5_GHZ_WITH_DFS = 6; // 0x6
    field public static final int WIFI_BAND_BOTH = 3; // 0x3
    field public static final int WIFI_BAND_BOTH_WITH_DFS = 7; // 0x7
    field public static final int WIFI_BAND_UNSPECIFIED = 0; // 0x0
  }

  public static interface WifiScanner.ActionListener {
    method public void onFailure(int, String);
    method public void onSuccess();
  }

  @Deprecated public static class WifiScanner.BssidInfo {
    ctor @Deprecated public WifiScanner.BssidInfo();
    field @Deprecated public String bssid;
    field @Deprecated public int frequencyHint;
    field @Deprecated public int high;
    field @Deprecated public int low;
  }

  @Deprecated public static interface WifiScanner.BssidListener extends android.net.wifi.WifiScanner.ActionListener {
    method @Deprecated public void onFound(android.net.wifi.ScanResult[]);
    method @Deprecated public void onLost(android.net.wifi.ScanResult[]);
  }

  public static class WifiScanner.ChannelSpec {
    ctor public WifiScanner.ChannelSpec(int);
    field public int frequency;
  }

  @Deprecated public static class WifiScanner.HotlistSettings implements android.os.Parcelable {
    ctor @Deprecated public WifiScanner.HotlistSettings();
    field @Deprecated public int apLostThreshold;
    field @Deprecated public android.net.wifi.WifiScanner.BssidInfo[] bssidInfos;
  }

  public static class WifiScanner.ParcelableScanData implements android.os.Parcelable {
    ctor public WifiScanner.ParcelableScanData(android.net.wifi.WifiScanner.ScanData[]);
    method public android.net.wifi.WifiScanner.ScanData[] getResults();
    field public android.net.wifi.WifiScanner.ScanData[] mResults;
  }

  public static class WifiScanner.ParcelableScanResults implements android.os.Parcelable {
    ctor public WifiScanner.ParcelableScanResults(android.net.wifi.ScanResult[]);
    method public android.net.wifi.ScanResult[] getResults();
    field public android.net.wifi.ScanResult[] mResults;
  }

  public static class WifiScanner.ScanData implements android.os.Parcelable {
    ctor public WifiScanner.ScanData(int, int, android.net.wifi.ScanResult[]);
    ctor public WifiScanner.ScanData(android.net.wifi.WifiScanner.ScanData);
    method public int getFlags();
    method public int getId();
    method public android.net.wifi.ScanResult[] getResults();
  }

  public static interface WifiScanner.ScanListener extends android.net.wifi.WifiScanner.ActionListener {
    method public void onFullResult(android.net.wifi.ScanResult);
    method public void onPeriodChanged(int);
    method public void onResults(android.net.wifi.WifiScanner.ScanData[]);
  }

  public static class WifiScanner.ScanSettings implements android.os.Parcelable {
    ctor public WifiScanner.ScanSettings();
    field public int band;
    field public android.net.wifi.WifiScanner.ChannelSpec[] channels;
    field public int maxPeriodInMs;
    field public int maxScansToCache;
    field public int numBssidsPerScan;
    field public int periodInMs;
    field public int reportEvents;
    field public int stepCount;
  }

  @Deprecated public static interface WifiScanner.WifiChangeListener extends android.net.wifi.WifiScanner.ActionListener {
    method @Deprecated public void onChanging(android.net.wifi.ScanResult[]);
    method @Deprecated public void onQuiescence(android.net.wifi.ScanResult[]);
  }

  @Deprecated public static class WifiScanner.WifiChangeSettings implements android.os.Parcelable {
    ctor @Deprecated public WifiScanner.WifiChangeSettings();
    field @Deprecated public android.net.wifi.WifiScanner.BssidInfo[] bssidInfos;
    field @Deprecated public int lostApSampleSize;
    field @Deprecated public int minApsBreachingThreshold;
    field @Deprecated public int periodInMs;
    field @Deprecated public int rssiSampleSize;
    field @Deprecated public int unchangedSampleSize;
  }

}

package android.net.wifi.aware {

  public class DiscoverySession implements java.lang.AutoCloseable {
    method public android.net.NetworkSpecifier createNetworkSpecifierPmk(@NonNull android.net.wifi.aware.PeerHandle, @NonNull byte[]);
  }

  public class WifiAwareSession implements java.lang.AutoCloseable {
    method public android.net.NetworkSpecifier createNetworkSpecifierPmk(int, @NonNull byte[], @NonNull byte[]);
  }

}

package android.net.wifi.rtt {

  public static final class RangingRequest.Builder {
    method public android.net.wifi.rtt.RangingRequest.Builder addResponder(@NonNull android.net.wifi.rtt.ResponderConfig);
  }

  public final class RangingResult implements android.os.Parcelable {
    method @NonNull public byte[] getLci();
    method @NonNull public byte[] getLcr();
  }

  public final class ResponderConfig implements android.os.Parcelable {
    ctor public ResponderConfig(@NonNull android.net.MacAddress, int, boolean, int, int, int, int, int);
    ctor public ResponderConfig(@NonNull android.net.wifi.aware.PeerHandle, int, boolean, int, int, int, int, int);
    method public int describeContents();
    method public static android.net.wifi.rtt.ResponderConfig fromScanResult(android.net.wifi.ScanResult);
    method public static android.net.wifi.rtt.ResponderConfig fromWifiAwarePeerHandleWithDefaults(android.net.wifi.aware.PeerHandle);
    method public static android.net.wifi.rtt.ResponderConfig fromWifiAwarePeerMacAddressWithDefaults(android.net.MacAddress);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CHANNEL_WIDTH_160MHZ = 3; // 0x3
    field public static final int CHANNEL_WIDTH_20MHZ = 0; // 0x0
    field public static final int CHANNEL_WIDTH_40MHZ = 1; // 0x1
    field public static final int CHANNEL_WIDTH_80MHZ = 2; // 0x2
    field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4; // 0x4
    field public static final android.os.Parcelable.Creator<android.net.wifi.rtt.ResponderConfig> CREATOR;
    field public static final int PREAMBLE_HT = 1; // 0x1
    field public static final int PREAMBLE_LEGACY = 0; // 0x0
    field public static final int PREAMBLE_VHT = 2; // 0x2
    field public static final int RESPONDER_AP = 0; // 0x0
    field public static final int RESPONDER_AWARE = 4; // 0x4
    field public static final int RESPONDER_P2P_CLIENT = 3; // 0x3
    field public static final int RESPONDER_P2P_GO = 2; // 0x2
    field public static final int RESPONDER_STA = 1; // 0x1
    field public final int centerFreq0;
    field public final int centerFreq1;
    field public final int channelWidth;
    field public final int frequency;
    field public final android.net.MacAddress macAddress;
    field public final android.net.wifi.aware.PeerHandle peerHandle;
    field public final int preamble;
    field public final int responderType;
    field public final boolean supports80211mc;
  }

  public class WifiRttManager {
    method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE}) public void cancelRanging(@Nullable android.os.WorkSource);
    method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.CHANGE_WIFI_STATE, android.Manifest.permission.ACCESS_WIFI_STATE}) public void startRanging(@Nullable android.os.WorkSource, @NonNull android.net.wifi.rtt.RangingRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.rtt.RangingResultCallback);
  }

}

package android.nfc {

  public final class NfcAdapter {
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean addNfcUnlockHandler(android.nfc.NfcAdapter.NfcUnlockHandler, String[]);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean disable();
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean disable(boolean);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean disableNdefPush();
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enable();
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enableNdefPush();
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean removeNfcUnlockHandler(android.nfc.NfcAdapter.NfcUnlockHandler);
    method public void setNdefPushMessage(android.nfc.NdefMessage, android.app.Activity, int);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean setNfcSecure(boolean);
    field public static final int FLAG_NDEF_PUSH_NO_CONFIRM = 1; // 0x1
  }

  public static interface NfcAdapter.NfcUnlockHandler {
    method public boolean onUnlockAttempted(android.nfc.Tag);
  }

}

package android.os {

  public class BatteryManager {
    field public static final String EXTRA_EVENTS = "android.os.extra.EVENTS";
    field public static final String EXTRA_EVENT_TIMESTAMP = "android.os.extra.EVENT_TIMESTAMP";
  }

  public class BugreportManager {
    method @RequiresPermission(android.Manifest.permission.DUMP) public void cancelBugreport();
    method @RequiresPermission(android.Manifest.permission.DUMP) public void startBugreport(@NonNull android.os.ParcelFileDescriptor, @Nullable android.os.ParcelFileDescriptor, @NonNull android.os.BugreportParams, @NonNull java.util.concurrent.Executor, @NonNull android.os.BugreportManager.BugreportCallback);
  }

  public abstract static class BugreportManager.BugreportCallback {
    ctor public BugreportManager.BugreportCallback();
    method public void onError(int);
    method public void onFinished();
    method public void onProgress(float);
    field public static final int BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS = 5; // 0x5
    field public static final int BUGREPORT_ERROR_INVALID_INPUT = 1; // 0x1
    field public static final int BUGREPORT_ERROR_RUNTIME = 2; // 0x2
    field public static final int BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT = 4; // 0x4
    field public static final int BUGREPORT_ERROR_USER_DENIED_CONSENT = 3; // 0x3
  }

  public final class BugreportParams {
    ctor public BugreportParams(@android.os.BugreportParams.BugreportMode int);
    method public int getMode();
    field public static final int BUGREPORT_MODE_FULL = 0; // 0x0
    field public static final int BUGREPORT_MODE_INTERACTIVE = 1; // 0x1
    field public static final int BUGREPORT_MODE_REMOTE = 2; // 0x2
    field public static final int BUGREPORT_MODE_TELEPHONY = 4; // 0x4
    field public static final int BUGREPORT_MODE_WEAR = 3; // 0x3
    field public static final int BUGREPORT_MODE_WIFI = 5; // 0x5
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef(prefix={"BUGREPORT_MODE_"}, value={android.os.BugreportParams.BUGREPORT_MODE_FULL, android.os.BugreportParams.BUGREPORT_MODE_INTERACTIVE, android.os.BugreportParams.BUGREPORT_MODE_REMOTE, android.os.BugreportParams.BUGREPORT_MODE_WEAR, android.os.BugreportParams.BUGREPORT_MODE_TELEPHONY, android.os.BugreportParams.BUGREPORT_MODE_WIFI}) public static @interface BugreportParams.BugreportMode {
  }

  public final class ConfigUpdate {
    field public static final String ACTION_UPDATE_CARRIER_ID_DB = "android.os.action.UPDATE_CARRIER_ID_DB";
    field public static final String ACTION_UPDATE_CARRIER_PROVISIONING_URLS = "android.intent.action.UPDATE_CARRIER_PROVISIONING_URLS";
    field public static final String ACTION_UPDATE_CT_LOGS = "android.intent.action.UPDATE_CT_LOGS";
    field public static final String ACTION_UPDATE_INTENT_FIREWALL = "android.intent.action.UPDATE_INTENT_FIREWALL";
    field public static final String ACTION_UPDATE_LANG_ID = "android.intent.action.UPDATE_LANG_ID";
    field public static final String ACTION_UPDATE_NETWORK_WATCHLIST = "android.intent.action.UPDATE_NETWORK_WATCHLIST";
    field public static final String ACTION_UPDATE_PINS = "android.intent.action.UPDATE_PINS";
    field public static final String ACTION_UPDATE_SMART_SELECTION = "android.intent.action.UPDATE_SMART_SELECTION";
    field public static final String ACTION_UPDATE_SMS_SHORT_CODES = "android.intent.action.UPDATE_SMS_SHORT_CODES";
  }

  public class HidlSupport {
    method public static boolean deepEquals(Object, Object);
    method public static int deepHashCode(Object);
    method public static int getPidIfSharable();
    method public static boolean interfacesEqual(android.os.IHwInterface, Object);
  }

  public abstract class HwBinder implements android.os.IHwBinder {
    ctor public HwBinder();
    method public static final void configureRpcThreadpool(long, boolean);
    method public static void enableInstrumentation();
    method public static final android.os.IHwBinder getService(String, String) throws java.util.NoSuchElementException, android.os.RemoteException;
    method public static final android.os.IHwBinder getService(String, String, boolean) throws java.util.NoSuchElementException, android.os.RemoteException;
    method public static final void joinRpcThreadpool();
    method public abstract void onTransact(int, android.os.HwParcel, android.os.HwParcel, int) throws android.os.RemoteException;
    method public final void registerService(String) throws android.os.RemoteException;
    method public final void transact(int, android.os.HwParcel, android.os.HwParcel, int) throws android.os.RemoteException;
  }

  public class HwBlob {
    ctor public HwBlob(int);
    method public final void copyToBoolArray(long, boolean[], int);
    method public final void copyToDoubleArray(long, double[], int);
    method public final void copyToFloatArray(long, float[], int);
    method public final void copyToInt16Array(long, short[], int);
    method public final void copyToInt32Array(long, int[], int);
    method public final void copyToInt64Array(long, long[], int);
    method public final void copyToInt8Array(long, byte[], int);
    method public final boolean getBool(long);
    method public final double getDouble(long);
    method public final float getFloat(long);
    method public final short getInt16(long);
    method public final int getInt32(long);
    method public final long getInt64(long);
    method public final byte getInt8(long);
    method public final String getString(long);
    method public final long handle();
    method public final void putBlob(long, android.os.HwBlob);
    method public final void putBool(long, boolean);
    method public final void putBoolArray(long, boolean[]);
    method public final void putDouble(long, double);
    method public final void putDoubleArray(long, double[]);
    method public final void putFloat(long, float);
    method public final void putFloatArray(long, float[]);
    method public final void putInt16(long, short);
    method public final void putInt16Array(long, short[]);
    method public final void putInt32(long, int);
    method public final void putInt32Array(long, int[]);
    method public final void putInt64(long, long);
    method public final void putInt64Array(long, long[]);
    method public final void putInt8(long, byte);
    method public final void putInt8Array(long, byte[]);
    method public final void putNativeHandle(long, @Nullable android.os.NativeHandle);
    method public final void putString(long, String);
    method public static Boolean[] wrapArray(@NonNull boolean[]);
    method public static Long[] wrapArray(@NonNull long[]);
    method public static Byte[] wrapArray(@NonNull byte[]);
    method public static Short[] wrapArray(@NonNull short[]);
    method public static Integer[] wrapArray(@NonNull int[]);
    method public static Float[] wrapArray(@NonNull float[]);
    method public static Double[] wrapArray(@NonNull double[]);
  }

  public class HwParcel {
    ctor public HwParcel();
    method public final void enforceInterface(String);
    method public final boolean readBool();
    method public final java.util.ArrayList<java.lang.Boolean> readBoolVector();
    method public final android.os.HwBlob readBuffer(long);
    method public final double readDouble();
    method public final java.util.ArrayList<java.lang.Double> readDoubleVector();
    method public final android.os.HwBlob readEmbeddedBuffer(long, long, long, boolean);
    method @Nullable public final android.os.NativeHandle readEmbeddedNativeHandle(long, long);
    method public final float readFloat();
    method public final java.util.ArrayList<java.lang.Float> readFloatVector();
    method public final short readInt16();
    method public final java.util.ArrayList<java.lang.Short> readInt16Vector();
    method public final int readInt32();
    method public final java.util.ArrayList<java.lang.Integer> readInt32Vector();
    method public final long readInt64();
    method public final java.util.ArrayList<java.lang.Long> readInt64Vector();
    method public final byte readInt8();
    method public final java.util.ArrayList<java.lang.Byte> readInt8Vector();
    method @Nullable public final android.os.NativeHandle readNativeHandle();
    method @NonNull public final java.util.ArrayList<android.os.NativeHandle> readNativeHandleVector();
    method public final String readString();
    method public final java.util.ArrayList<java.lang.String> readStringVector();
    method public final android.os.IHwBinder readStrongBinder();
    method public final void release();
    method public final void releaseTemporaryStorage();
    method public final void send();
    method public final void verifySuccess();
    method public final void writeBool(boolean);
    method public final void writeBoolVector(java.util.ArrayList<java.lang.Boolean>);
    method public final void writeBuffer(android.os.HwBlob);
    method public final void writeDouble(double);
    method public final void writeDoubleVector(java.util.ArrayList<java.lang.Double>);
    method public final void writeFloat(float);
    method public final void writeFloatVector(java.util.ArrayList<java.lang.Float>);
    method public final void writeInt16(short);
    method public final void writeInt16Vector(java.util.ArrayList<java.lang.Short>);
    method public final void writeInt32(int);
    method public final void writeInt32Vector(java.util.ArrayList<java.lang.Integer>);
    method public final void writeInt64(long);
    method public final void writeInt64Vector(java.util.ArrayList<java.lang.Long>);
    method public final void writeInt8(byte);
    method public final void writeInt8Vector(java.util.ArrayList<java.lang.Byte>);
    method public final void writeInterfaceToken(String);
    method public final void writeNativeHandle(@Nullable android.os.NativeHandle);
    method public final void writeNativeHandleVector(@NonNull java.util.ArrayList<android.os.NativeHandle>);
    method public final void writeStatus(int);
    method public final void writeString(String);
    method public final void writeStringVector(java.util.ArrayList<java.lang.String>);
    method public final void writeStrongBinder(android.os.IHwBinder);
    field public static final int STATUS_SUCCESS = 0; // 0x0
  }

  @IntDef(prefix={"STATUS_"}, value={android.os.HwParcel.STATUS_SUCCESS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface HwParcel.Status {
  }

  public interface IHwBinder {
    method public boolean linkToDeath(android.os.IHwBinder.DeathRecipient, long);
    method public android.os.IHwInterface queryLocalInterface(String);
    method public void transact(int, android.os.HwParcel, android.os.HwParcel, int) throws android.os.RemoteException;
    method public boolean unlinkToDeath(android.os.IHwBinder.DeathRecipient);
  }

  public static interface IHwBinder.DeathRecipient {
    method public void serviceDied(long);
  }

  public interface IHwInterface {
    method public android.os.IHwBinder asBinder();
  }

  public class IncidentManager {
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void reportIncident(android.os.IncidentReportArgs);
  }

  public final class IncidentReportArgs implements android.os.Parcelable {
    ctor public IncidentReportArgs();
    ctor public IncidentReportArgs(android.os.Parcel);
    method public void addHeader(byte[]);
    method public void addSection(int);
    method public boolean containsSection(int);
    method public int describeContents();
    method public boolean isAll();
    method public void readFromParcel(android.os.Parcel);
    method public int sectionCount();
    method public void setAll(boolean);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.IncidentReportArgs> CREATOR;
  }

  public final class NativeHandle implements java.io.Closeable {
    ctor public NativeHandle();
    ctor public NativeHandle(@NonNull java.io.FileDescriptor, boolean);
    ctor public NativeHandle(@NonNull java.io.FileDescriptor[], @NonNull int[], boolean);
    method public void close() throws java.io.IOException;
    method @NonNull public android.os.NativeHandle dup() throws java.io.IOException;
    method @NonNull public java.io.FileDescriptor getFileDescriptor();
    method @NonNull public java.io.FileDescriptor[] getFileDescriptors();
    method @NonNull public int[] getInts();
    method public boolean hasSingleFileDescriptor();
  }

  public final class PowerManager {
    method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.USER_ACTIVITY}) public void userActivity(long, int, int);
    field public static final int USER_ACTIVITY_EVENT_ACCESSIBILITY = 3; // 0x3
    field public static final int USER_ACTIVITY_EVENT_BUTTON = 1; // 0x1
    field public static final int USER_ACTIVITY_EVENT_OTHER = 0; // 0x0
    field public static final int USER_ACTIVITY_EVENT_TOUCH = 2; // 0x2
    field public static final int USER_ACTIVITY_FLAG_INDIRECT = 2; // 0x2
    field public static final int USER_ACTIVITY_FLAG_NO_CHANGE_LIGHTS = 1; // 0x1
  }

  public class RecoverySystem {
    method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void cancelScheduledUpdate(android.content.Context) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void installPackage(android.content.Context, java.io.File, boolean) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void processPackage(android.content.Context, java.io.File, android.os.RecoverySystem.ProgressListener, android.os.Handler) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void processPackage(android.content.Context, java.io.File, android.os.RecoverySystem.ProgressListener) throws java.io.IOException;
    method @RequiresPermission(allOf={android.Manifest.permission.RECOVERY, android.Manifest.permission.REBOOT}) public static void rebootWipeAb(android.content.Context, java.io.File, String) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void scheduleUpdateOnBoot(android.content.Context, java.io.File) throws java.io.IOException;
    method public static boolean verifyPackageCompatibility(java.io.File) throws java.io.IOException;
  }

  public final class RemoteCallback implements android.os.Parcelable {
    ctor public RemoteCallback(android.os.RemoteCallback.OnResultListener);
    ctor public RemoteCallback(@NonNull android.os.RemoteCallback.OnResultListener, @Nullable android.os.Handler);
    method public int describeContents();
    method public void sendResult(@Nullable android.os.Bundle);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.RemoteCallback> CREATOR;
  }

  public static interface RemoteCallback.OnResultListener {
    method public void onResult(android.os.Bundle);
  }

  public class ServiceSpecificException extends java.lang.RuntimeException {
    ctor public ServiceSpecificException(int, String);
    ctor public ServiceSpecificException(int);
    field public final int errorCode;
  }

  public final class StatsDimensionsValue implements android.os.Parcelable {
    method public int describeContents();
    method public boolean getBooleanValue();
    method public int getField();
    method public float getFloatValue();
    method public int getIntValue();
    method public long getLongValue();
    method public String getStringValue();
    method public java.util.List<android.os.StatsDimensionsValue> getTupleValueList();
    method public int getValueType();
    method public boolean isValueType(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int BOOLEAN_VALUE_TYPE = 5; // 0x5
    field public static final android.os.Parcelable.Creator<android.os.StatsDimensionsValue> CREATOR;
    field public static final int FLOAT_VALUE_TYPE = 6; // 0x6
    field public static final int INT_VALUE_TYPE = 3; // 0x3
    field public static final int LONG_VALUE_TYPE = 4; // 0x4
    field public static final int STRING_VALUE_TYPE = 2; // 0x2
    field public static final int TUPLE_VALUE_TYPE = 7; // 0x7
  }

  public class SystemProperties {
    method @NonNull public static String get(@NonNull String);
    method @NonNull public static String get(@NonNull String, @Nullable String);
    method public static boolean getBoolean(@NonNull String, boolean);
    method public static int getInt(@NonNull String, int);
    method public static long getLong(@NonNull String, long);
  }

  public class SystemUpdateManager {
    method @RequiresPermission(anyOf={android.Manifest.permission.READ_SYSTEM_UPDATE_INFO, android.Manifest.permission.RECOVERY}) public android.os.Bundle retrieveSystemUpdateInfo();
    method @RequiresPermission(android.Manifest.permission.RECOVERY) public void updateSystemUpdateInfo(android.os.PersistableBundle);
    field public static final String KEY_IS_SECURITY_UPDATE = "is_security_update";
    field public static final String KEY_STATUS = "status";
    field public static final String KEY_TARGET_BUILD_FINGERPRINT = "target_build_fingerprint";
    field public static final String KEY_TARGET_SECURITY_PATCH_LEVEL = "target_security_patch_level";
    field public static final String KEY_TITLE = "title";
    field public static final int STATUS_IDLE = 1; // 0x1
    field public static final int STATUS_IN_PROGRESS = 3; // 0x3
    field public static final int STATUS_UNKNOWN = 0; // 0x0
    field public static final int STATUS_WAITING_DOWNLOAD = 2; // 0x2
    field public static final int STATUS_WAITING_INSTALL = 4; // 0x4
    field public static final int STATUS_WAITING_REBOOT = 5; // 0x5
  }

  public class UpdateEngine {
    ctor public UpdateEngine();
    method public void applyPayload(String, long, long, String[]);
    method public boolean bind(android.os.UpdateEngineCallback, android.os.Handler);
    method public boolean bind(android.os.UpdateEngineCallback);
    method public void cancel();
    method public void resetStatus();
    method public void resume();
    method public void suspend();
    method public boolean unbind();
    method public boolean verifyPayloadMetadata(String);
  }

  public static final class UpdateEngine.ErrorCodeConstants {
    ctor public UpdateEngine.ErrorCodeConstants();
    field public static final int DOWNLOAD_PAYLOAD_VERIFICATION_ERROR = 12; // 0xc
    field public static final int DOWNLOAD_TRANSFER_ERROR = 9; // 0x9
    field public static final int ERROR = 1; // 0x1
    field public static final int FILESYSTEM_COPIER_ERROR = 4; // 0x4
    field public static final int INSTALL_DEVICE_OPEN_ERROR = 7; // 0x7
    field public static final int KERNEL_DEVICE_OPEN_ERROR = 8; // 0x8
    field public static final int PAYLOAD_HASH_MISMATCH_ERROR = 10; // 0xa
    field public static final int PAYLOAD_MISMATCHED_TYPE_ERROR = 6; // 0x6
    field public static final int PAYLOAD_SIZE_MISMATCH_ERROR = 11; // 0xb
    field public static final int POST_INSTALL_RUNNER_ERROR = 5; // 0x5
    field public static final int SUCCESS = 0; // 0x0
    field public static final int UPDATED_BUT_NOT_ACTIVE = 52; // 0x34
  }

  public static final class UpdateEngine.UpdateStatusConstants {
    ctor public UpdateEngine.UpdateStatusConstants();
    field public static final int ATTEMPTING_ROLLBACK = 8; // 0x8
    field public static final int CHECKING_FOR_UPDATE = 1; // 0x1
    field public static final int DISABLED = 9; // 0x9
    field public static final int DOWNLOADING = 3; // 0x3
    field public static final int FINALIZING = 5; // 0x5
    field public static final int IDLE = 0; // 0x0
    field public static final int REPORTING_ERROR_EVENT = 7; // 0x7
    field public static final int UPDATED_NEED_REBOOT = 6; // 0x6
    field public static final int UPDATE_AVAILABLE = 2; // 0x2
    field public static final int VERIFYING = 4; // 0x4
  }

  public abstract class UpdateEngineCallback {
    ctor public UpdateEngineCallback();
    method public abstract void onPayloadApplicationComplete(int);
    method public abstract void onStatusUpdate(int, float);
  }

  public final class UserHandle implements android.os.Parcelable {
    method public static int getAppId(int);
    method public int getIdentifier();
    method @Deprecated public boolean isOwner();
    method public boolean isSystem();
    method public static int myUserId();
    method public static android.os.UserHandle of(int);
    field public static final android.os.UserHandle ALL;
    field public static final android.os.UserHandle CURRENT;
    field public static final android.os.UserHandle SYSTEM;
  }

  public class UserManager {
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void clearSeedAccountData();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getSeedAccountName();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.os.PersistableBundle getSeedAccountOptions();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public String getSeedAccountType();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public long[] getSerialNumbersOfUsers(boolean);
    method @Deprecated @android.os.UserManager.UserRestrictionSource @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public int getUserRestrictionSource(String, android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public java.util.List<android.os.UserManager.EnforcingUser> getUserRestrictionSources(String, android.os.UserHandle);
    method public boolean hasRestrictedProfiles();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isManagedProfile();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isManagedProfile(int);
    method public boolean isRestrictedProfile();
    field public static final String ACTION_USER_RESTRICTIONS_CHANGED = "android.os.action.USER_RESTRICTIONS_CHANGED";
    field @Deprecated public static final String DISALLOW_OEM_UNLOCK = "no_oem_unlock";
    field public static final String DISALLOW_RUN_IN_BACKGROUND = "no_run_in_background";
    field public static final int RESTRICTION_NOT_SET = 0; // 0x0
    field public static final int RESTRICTION_SOURCE_DEVICE_OWNER = 2; // 0x2
    field public static final int RESTRICTION_SOURCE_PROFILE_OWNER = 4; // 0x4
    field public static final int RESTRICTION_SOURCE_SYSTEM = 1; // 0x1
  }

  public static final class UserManager.EnforcingUser implements android.os.Parcelable {
    method public int describeContents();
    method public android.os.UserHandle getUserHandle();
    method @android.os.UserManager.UserRestrictionSource public int getUserRestrictionSource();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.UserManager.EnforcingUser> CREATOR;
  }

  @IntDef(flag=true, prefix={"RESTRICTION_"}, value={android.os.UserManager.RESTRICTION_NOT_SET, android.os.UserManager.RESTRICTION_SOURCE_SYSTEM, android.os.UserManager.RESTRICTION_SOURCE_DEVICE_OWNER, android.os.UserManager.RESTRICTION_SOURCE_PROFILE_OWNER}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface UserManager.UserRestrictionSource {
  }

  public class WorkSource implements android.os.Parcelable {
    method public android.os.WorkSource.WorkChain createWorkChain();
  }

  public static final class WorkSource.WorkChain implements android.os.Parcelable {
    ctor public WorkSource.WorkChain();
    method public android.os.WorkSource.WorkChain addNode(int, @Nullable String);
    method public int describeContents();
    method public String getAttributionTag();
    method public int getAttributionUid();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.os.WorkSource.WorkChain> CREATOR;
  }

}

package android.os.storage {

  public class StorageManager {
    method @WorkerThread public void allocateBytes(@NonNull java.util.UUID, long, @RequiresPermission int) throws java.io.IOException;
    method @WorkerThread public void allocateBytes(java.io.FileDescriptor, long, @RequiresPermission int) throws java.io.IOException;
    method @WorkerThread public long getAllocatableBytes(@NonNull java.util.UUID, @RequiresPermission int) throws java.io.IOException;
    field @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1
  }

}

package android.permissionpresenterservice {

  public abstract class RuntimePermissionPresenterService extends android.app.Service {
    ctor public RuntimePermissionPresenterService();
    method public final void attachBaseContext(android.content.Context);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract java.util.List<android.content.pm.permission.RuntimePermissionPresentationInfo> onGetAppPermissions(String);
    field public static final String SERVICE_INTERFACE = "android.permissionpresenterservice.RuntimePermissionPresenterService";
  }

}

package android.preference {

  public class PreferenceManager {
    method public boolean isStorageCredentialProtected();
    method public void setStorageCredentialProtected();
  }

}

package android.print {

  public final class PrintManager {
    method @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICE_RECOMMENDATIONS) public void addPrintServiceRecommendationsChangeListener(@NonNull android.print.PrintManager.PrintServiceRecommendationsChangeListener, @Nullable android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICES) public void addPrintServicesChangeListener(@NonNull android.print.PrintManager.PrintServicesChangeListener, @Nullable android.os.Handler);
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICE_RECOMMENDATIONS) public java.util.List<android.printservice.recommendation.RecommendationInfo> getPrintServiceRecommendations();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICES) public java.util.List<android.printservice.PrintServiceInfo> getPrintServices(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICE_RECOMMENDATIONS) public void removePrintServiceRecommendationsChangeListener(@NonNull android.print.PrintManager.PrintServiceRecommendationsChangeListener);
    method @RequiresPermission(android.Manifest.permission.READ_PRINT_SERVICES) public void removePrintServicesChangeListener(@NonNull android.print.PrintManager.PrintServicesChangeListener);
    field public static final int ENABLED_SERVICES = 1; // 0x1
  }

  public static interface PrintManager.PrintServiceRecommendationsChangeListener {
    method public void onPrintServiceRecommendationsChanged();
  }

  public static interface PrintManager.PrintServicesChangeListener {
    method public void onPrintServicesChanged();
  }

}

package android.printservice {

  public final class PrintServiceInfo implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.content.ComponentName getComponentName();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.printservice.PrintServiceInfo> CREATOR;
  }

}

package android.printservice.recommendation {

  public final class RecommendationInfo implements android.os.Parcelable {
    ctor public RecommendationInfo(@NonNull CharSequence, @NonNull CharSequence, @NonNull java.util.List<java.net.InetAddress>, boolean);
    ctor @Deprecated public RecommendationInfo(@NonNull CharSequence, @NonNull CharSequence, @IntRange(from=0) int, boolean);
    method public int describeContents();
    method @NonNull public java.util.List<java.net.InetAddress> getDiscoveredPrinters();
    method public CharSequence getName();
    method public int getNumDiscoveredPrinters();
    method public CharSequence getPackageName();
    method public boolean recommendsMultiVendorService();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.printservice.recommendation.RecommendationInfo> CREATOR;
  }

  public abstract class RecommendationService extends android.app.Service {
    ctor public RecommendationService();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract void onConnected();
    method public abstract void onDisconnected();
    method public final void updateRecommendations(@Nullable java.util.List<android.printservice.recommendation.RecommendationInfo>);
    field public static final String SERVICE_INTERFACE = "android.printservice.recommendation.RecommendationService";
  }

}

package android.provider {

  public static final class ContactsContract.MetadataSync implements android.provider.BaseColumns android.provider.ContactsContract.MetadataSyncColumns {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_metadata";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_metadata";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String METADATA_AUTHORITY = "com.android.contacts.metadata";
    field public static final android.net.Uri METADATA_AUTHORITY_URI;
  }

  protected static interface ContactsContract.MetadataSyncColumns {
    field public static final String ACCOUNT_NAME = "account_name";
    field public static final String ACCOUNT_TYPE = "account_type";
    field public static final String DATA = "data";
    field public static final String DATA_SET = "data_set";
    field public static final String DELETED = "deleted";
    field public static final String RAW_CONTACT_BACKUP_ID = "raw_contact_backup_id";
  }

  public static final class ContactsContract.MetadataSyncState implements android.provider.BaseColumns android.provider.ContactsContract.MetadataSyncStateColumns {
    field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_metadata_sync_state";
    field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_metadata_sync_state";
    field public static final android.net.Uri CONTENT_URI;
  }

  protected static interface ContactsContract.MetadataSyncStateColumns {
    field public static final String ACCOUNT_NAME = "account_name";
    field public static final String ACCOUNT_TYPE = "account_type";
    field public static final String DATA_SET = "data_set";
    field public static final String STATE = "state";
  }

  public abstract class SearchIndexableData {
    ctor public SearchIndexableData();
    ctor public SearchIndexableData(android.content.Context);
    field public String className;
    field public android.content.Context context;
    field public boolean enabled;
    field public int iconResId;
    field public String intentAction;
    field public String intentTargetClass;
    field public String intentTargetPackage;
    field public String key;
    field public java.util.Locale locale;
    field public String packageName;
    field public int rank;
    field public int userId;
  }

  public class SearchIndexableResource extends android.provider.SearchIndexableData {
    ctor public SearchIndexableResource(int, int, String, int);
    ctor public SearchIndexableResource(android.content.Context);
    field public int xmlResId;
  }

  public class SearchIndexablesContract {
    ctor public SearchIndexablesContract();
    field public static final int COLUMN_INDEX_NON_INDEXABLE_KEYS_KEY_VALUE = 0; // 0x0
    field public static final int COLUMN_INDEX_RAW_CLASS_NAME = 7; // 0x7
    field public static final int COLUMN_INDEX_RAW_ENTRIES = 4; // 0x4
    field public static final int COLUMN_INDEX_RAW_ICON_RESID = 8; // 0x8
    field public static final int COLUMN_INDEX_RAW_INTENT_ACTION = 9; // 0x9
    field public static final int COLUMN_INDEX_RAW_INTENT_TARGET_CLASS = 11; // 0xb
    field public static final int COLUMN_INDEX_RAW_INTENT_TARGET_PACKAGE = 10; // 0xa
    field public static final int COLUMN_INDEX_RAW_KEY = 12; // 0xc
    field public static final int COLUMN_INDEX_RAW_KEYWORDS = 5; // 0x5
    field public static final int COLUMN_INDEX_RAW_RANK = 0; // 0x0
    field public static final int COLUMN_INDEX_RAW_SCREEN_TITLE = 6; // 0x6
    field public static final int COLUMN_INDEX_RAW_SUMMARY_OFF = 3; // 0x3
    field public static final int COLUMN_INDEX_RAW_SUMMARY_ON = 2; // 0x2
    field public static final int COLUMN_INDEX_RAW_TITLE = 1; // 0x1
    field public static final int COLUMN_INDEX_RAW_USER_ID = 13; // 0xd
    field public static final int COLUMN_INDEX_XML_RES_CLASS_NAME = 2; // 0x2
    field public static final int COLUMN_INDEX_XML_RES_ICON_RESID = 3; // 0x3
    field public static final int COLUMN_INDEX_XML_RES_INTENT_ACTION = 4; // 0x4
    field public static final int COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS = 6; // 0x6
    field public static final int COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE = 5; // 0x5
    field public static final int COLUMN_INDEX_XML_RES_RANK = 0; // 0x0
    field public static final int COLUMN_INDEX_XML_RES_RESID = 1; // 0x1
    field public static final String INDEXABLES_RAW = "indexables_raw";
    field public static final String[] INDEXABLES_RAW_COLUMNS;
    field public static final String INDEXABLES_RAW_PATH = "settings/indexables_raw";
    field public static final String INDEXABLES_XML_RES = "indexables_xml_res";
    field public static final String[] INDEXABLES_XML_RES_COLUMNS;
    field public static final String INDEXABLES_XML_RES_PATH = "settings/indexables_xml_res";
    field public static final String NON_INDEXABLES_KEYS = "non_indexables_key";
    field public static final String[] NON_INDEXABLES_KEYS_COLUMNS;
    field public static final String NON_INDEXABLES_KEYS_PATH = "settings/non_indexables_key";
    field public static final String PROVIDER_INTERFACE = "android.content.action.SEARCH_INDEXABLES_PROVIDER";
  }

  public static class SearchIndexablesContract.BaseColumns {
    field public static final String COLUMN_CLASS_NAME = "className";
    field public static final String COLUMN_ICON_RESID = "iconResId";
    field public static final String COLUMN_INTENT_ACTION = "intentAction";
    field public static final String COLUMN_INTENT_TARGET_CLASS = "intentTargetClass";
    field public static final String COLUMN_INTENT_TARGET_PACKAGE = "intentTargetPackage";
    field public static final String COLUMN_RANK = "rank";
  }

  public static final class SearchIndexablesContract.NonIndexableKey extends android.provider.SearchIndexablesContract.BaseColumns {
    field public static final String COLUMN_KEY_VALUE = "key";
    field public static final String MIME_TYPE = "vnd.android.cursor.dir/non_indexables_key";
  }

  public static final class SearchIndexablesContract.RawData extends android.provider.SearchIndexablesContract.BaseColumns {
    field public static final String COLUMN_ENTRIES = "entries";
    field public static final String COLUMN_KEY = "key";
    field public static final String COLUMN_KEYWORDS = "keywords";
    field public static final String COLUMN_SCREEN_TITLE = "screenTitle";
    field public static final String COLUMN_SUMMARY_OFF = "summaryOff";
    field public static final String COLUMN_SUMMARY_ON = "summaryOn";
    field public static final String COLUMN_TITLE = "title";
    field public static final String COLUMN_USER_ID = "user_id";
    field public static final String MIME_TYPE = "vnd.android.cursor.dir/indexables_raw";
  }

  public static final class SearchIndexablesContract.XmlResource extends android.provider.SearchIndexablesContract.BaseColumns {
    field public static final String COLUMN_XML_RESID = "xmlResId";
    field public static final String MIME_TYPE = "vnd.android.cursor.dir/indexables_xml_res";
  }

  public abstract class SearchIndexablesProvider extends android.content.ContentProvider {
    ctor public SearchIndexablesProvider();
    method public final int delete(android.net.Uri, String, String[]);
    method public String getType(android.net.Uri);
    method public final android.net.Uri insert(android.net.Uri, android.content.ContentValues);
    method public android.database.Cursor query(android.net.Uri, String[], String, String[], String);
    method public abstract android.database.Cursor queryNonIndexableKeys(String[]);
    method public abstract android.database.Cursor queryRawData(String[]);
    method public abstract android.database.Cursor queryXmlResources(String[]);
    method public final int update(android.net.Uri, android.content.ContentValues, String, String[]);
  }

  public final class Settings {
    field public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
  }

  public static final class Settings.Global extends android.provider.Settings.NameValueTable {
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static boolean putString(@NonNull android.content.ContentResolver, @NonNull String, @Nullable String, @Nullable String, boolean);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static void resetToDefaults(@NonNull android.content.ContentResolver, @Nullable String);
    field public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = "autofill_compat_mode_allowed_packages";
    field public static final String CAPTIVE_PORTAL_FALLBACK_PROBE_SPECS = "captive_portal_fallback_probe_specs";
    field public static final String CAPTIVE_PORTAL_FALLBACK_URL = "captive_portal_fallback_url";
    field public static final String CAPTIVE_PORTAL_HTTPS_URL = "captive_portal_https_url";
    field public static final String CAPTIVE_PORTAL_HTTP_URL = "captive_portal_http_url";
    field public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
    field public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; // 0x2
    field public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; // 0x0
    field public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; // 0x1
    field public static final String CAPTIVE_PORTAL_OTHER_FALLBACK_URLS = "captive_portal_other_fallback_urls";
    field public static final String CAPTIVE_PORTAL_USER_AGENT = "captive_portal_user_agent";
    field public static final String CAPTIVE_PORTAL_USE_HTTPS = "captive_portal_use_https";
    field public static final String CARRIER_APP_NAMES = "carrier_app_names";
    field public static final String CARRIER_APP_WHITELIST = "carrier_app_whitelist";
    field public static final String DATA_STALL_CONSECUTIVE_DNS_TIMEOUT_THRESHOLD = "data_stall_consecutive_dns_timeout_threshold";
    field public static final String DATA_STALL_EVALUATION_TYPE = "data_stall_evaluation_type";
    field public static final int DATA_STALL_EVALUATION_TYPE_DNS = 1; // 0x1
    field public static final String DATA_STALL_MIN_EVALUATE_INTERVAL = "data_stall_min_evaluate_interval";
    field public static final String DATA_STALL_VALID_DNS_TIME_THRESHOLD = "data_stall_valid_dns_time_threshold";
    field public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
    field public static final String EUICC_PROVISIONED = "euicc_provisioned";
    field public static final String INSTALL_CARRIER_APP_NOTIFICATION_PERSISTENT = "install_carrier_app_notification_persistent";
    field public static final String INSTALL_CARRIER_APP_NOTIFICATION_SLEEP_MILLIS = "install_carrier_app_notification_sleep_millis";
    field public static final String OTA_DISABLE_AUTOMATIC_UPDATE = "ota_disable_automatic_update";
    field public static final String THEATER_MODE_ON = "theater_mode_on";
    field public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
    field public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
    field public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
  }

  public static final class Settings.Secure extends android.provider.Settings.NameValueTable {
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static boolean putString(@NonNull android.content.ContentResolver, @NonNull String, @Nullable String, @Nullable String, boolean);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static void resetToDefaults(@NonNull android.content.ContentResolver, @Nullable String);
    field public static final String AUTOFILL_FEATURE_FIELD_CLASSIFICATION = "autofill_field_classification";
    field public static final String AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT = "autofill_user_data_max_category_count";
    field public static final String AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE = "autofill_user_data_max_field_classification_size";
    field public static final String AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE = "autofill_user_data_max_user_data_size";
    field public static final String AUTOFILL_USER_DATA_MAX_VALUE_LENGTH = "autofill_user_data_max_value_length";
    field public static final String AUTOFILL_USER_DATA_MIN_VALUE_LENGTH = "autofill_user_data_min_value_length";
    field public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
  }

  public static final class Telephony.Carriers implements android.provider.BaseColumns {
    field public static final String APN_SET_ID = "apn_set_id";
    field public static final int CARRIER_EDITED = 4; // 0x4
    field public static final String EDITED_STATUS = "edited";
    field public static final String MAX_CONNECTIONS = "max_conns";
    field public static final String MODEM_PERSIST = "modem_cognitive";
    field public static final String MTU = "mtu";
    field public static final int NO_APN_SET_ID = 0; // 0x0
    field public static final String TIME_LIMIT_FOR_MAX_CONNECTIONS = "max_conns_time";
    field public static final int UNEDITED = 0; // 0x0
    field public static final int USER_DELETED = 2; // 0x2
    field public static final String USER_EDITABLE = "user_editable";
    field public static final int USER_EDITED = 1; // 0x1
    field public static final String USER_VISIBLE = "user_visible";
    field public static final String WAIT_TIME_RETRY = "wait_time";
  }

  public final class TimeZoneRulesDataContract {
    field public static final String AUTHORITY = "com.android.timezone";
  }

  public static final class TimeZoneRulesDataContract.Operation {
    field public static final String COLUMN_DISTRO_MAJOR_VERSION = "distro_major_version";
    field public static final String COLUMN_DISTRO_MINOR_VERSION = "distro_minor_version";
    field public static final String COLUMN_REVISION = "revision";
    field public static final String COLUMN_RULES_VERSION = "rules_version";
    field public static final String COLUMN_TYPE = "type";
    field public static final android.net.Uri CONTENT_URI;
    field public static final String TYPE_INSTALL = "INSTALL";
    field public static final String TYPE_NO_OP = "NOOP";
    field public static final String TYPE_UNINSTALL = "UNINSTALL";
  }

}

package android.security.keystore {

  public abstract class AttestationUtils {
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @NonNull public static java.security.cert.X509Certificate[] attestDeviceIds(android.content.Context, @NonNull int[], @NonNull byte[]) throws android.security.keystore.DeviceIdAttestationException;
    field public static final int ID_TYPE_IMEI = 2; // 0x2
    field public static final int ID_TYPE_MEID = 3; // 0x3
    field public static final int ID_TYPE_SERIAL = 1; // 0x1
  }

  public class DeviceIdAttestationException extends java.lang.Exception {
    ctor public DeviceIdAttestationException(String);
    ctor public DeviceIdAttestationException(String, Throwable);
  }

}

package android.security.keystore.recovery {

  public class DecryptionFailedException extends java.security.GeneralSecurityException {
    ctor public DecryptionFailedException(String);
  }

  public class InternalRecoveryServiceException extends java.security.GeneralSecurityException {
    ctor public InternalRecoveryServiceException(String);
    ctor public InternalRecoveryServiceException(String, Throwable);
  }

  public final class KeyChainProtectionParams implements android.os.Parcelable {
    method public void clearSecret();
    method public int describeContents();
    method @NonNull public android.security.keystore.recovery.KeyDerivationParams getKeyDerivationParams();
    method public int getLockScreenUiFormat();
    method @NonNull public byte[] getSecret();
    method public int getUserSecretType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.security.keystore.recovery.KeyChainProtectionParams> CREATOR;
    field public static final int TYPE_LOCKSCREEN = 100; // 0x64
    field public static final int UI_FORMAT_PASSWORD = 2; // 0x2
    field public static final int UI_FORMAT_PATTERN = 3; // 0x3
    field public static final int UI_FORMAT_PIN = 1; // 0x1
  }

  public static class KeyChainProtectionParams.Builder {
    ctor public KeyChainProtectionParams.Builder();
    method @NonNull public android.security.keystore.recovery.KeyChainProtectionParams build();
    method public android.security.keystore.recovery.KeyChainProtectionParams.Builder setKeyDerivationParams(@NonNull android.security.keystore.recovery.KeyDerivationParams);
    method public android.security.keystore.recovery.KeyChainProtectionParams.Builder setLockScreenUiFormat(int);
    method public android.security.keystore.recovery.KeyChainProtectionParams.Builder setSecret(@NonNull byte[]);
    method public android.security.keystore.recovery.KeyChainProtectionParams.Builder setUserSecretType(int);
  }

  public final class KeyChainSnapshot implements android.os.Parcelable {
    method public int describeContents();
    method public long getCounterId();
    method @NonNull public byte[] getEncryptedRecoveryKeyBlob();
    method @NonNull public java.util.List<android.security.keystore.recovery.KeyChainProtectionParams> getKeyChainProtectionParams();
    method public int getMaxAttempts();
    method @NonNull public byte[] getServerParams();
    method public int getSnapshotVersion();
    method @NonNull public java.security.cert.CertPath getTrustedHardwareCertPath();
    method @NonNull public java.util.List<android.security.keystore.recovery.WrappedApplicationKey> getWrappedApplicationKeys();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.security.keystore.recovery.KeyChainSnapshot> CREATOR;
  }

  public final class KeyDerivationParams implements android.os.Parcelable {
    method @NonNull public static android.security.keystore.recovery.KeyDerivationParams createScryptParams(@NonNull byte[], int);
    method @NonNull public static android.security.keystore.recovery.KeyDerivationParams createSha256Params(@NonNull byte[]);
    method public int describeContents();
    method public int getAlgorithm();
    method public int getMemoryDifficulty();
    method @NonNull public byte[] getSalt();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ALGORITHM_SCRYPT = 2; // 0x2
    field public static final int ALGORITHM_SHA256 = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.security.keystore.recovery.KeyDerivationParams> CREATOR;
  }

  public class LockScreenRequiredException extends java.security.GeneralSecurityException {
    ctor public LockScreenRequiredException(String);
  }

  public class RecoveryController {
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @NonNull public android.security.keystore.recovery.RecoverySession createRecoverySession();
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @NonNull public java.security.Key generateKey(@NonNull String) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @NonNull public java.util.List<java.lang.String> getAliases() throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @NonNull public static android.security.keystore.recovery.RecoveryController getInstance(@NonNull android.content.Context);
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @Nullable public java.security.Key getKey(@NonNull String) throws android.security.keystore.recovery.InternalRecoveryServiceException, java.security.UnrecoverableKeyException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @Nullable public android.security.keystore.recovery.KeyChainSnapshot getKeyChainSnapshot() throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public int[] getRecoverySecretTypes() throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public int getRecoveryStatus(@NonNull String) throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @NonNull public java.util.Map<java.lang.String,java.security.cert.X509Certificate> getRootCertificates();
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @NonNull public java.security.Key importKey(@NonNull String, @NonNull byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void initRecoveryService(@NonNull String, @NonNull byte[], @NonNull byte[]) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public static boolean isRecoverableKeyStoreEnabled(@NonNull android.content.Context);
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void removeKey(@NonNull String) throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void setRecoverySecretTypes(@NonNull int[]) throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void setRecoveryStatus(@NonNull String, int) throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void setServerParams(@NonNull byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void setSnapshotCreatedPendingIntent(@Nullable android.app.PendingIntent) throws android.security.keystore.recovery.InternalRecoveryServiceException;
    field public static final int RECOVERY_STATUS_PERMANENT_FAILURE = 3; // 0x3
    field public static final int RECOVERY_STATUS_SYNCED = 0; // 0x0
    field public static final int RECOVERY_STATUS_SYNC_IN_PROGRESS = 1; // 0x1
  }

  public class RecoverySession implements java.lang.AutoCloseable {
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public void close();
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @NonNull public java.util.Map<java.lang.String,java.security.Key> recoverKeyChainSnapshot(@NonNull byte[], @NonNull java.util.List<android.security.keystore.recovery.WrappedApplicationKey>) throws android.security.keystore.recovery.DecryptionFailedException, android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.SessionExpiredException;
    method @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) @NonNull public byte[] start(@NonNull String, @NonNull java.security.cert.CertPath, @NonNull byte[], @NonNull byte[], @NonNull java.util.List<android.security.keystore.recovery.KeyChainProtectionParams>) throws java.security.cert.CertificateException, android.security.keystore.recovery.InternalRecoveryServiceException;
  }

  public class SessionExpiredException extends java.security.GeneralSecurityException {
    ctor public SessionExpiredException(String);
  }

  public final class WrappedApplicationKey implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public String getAlias();
    method @NonNull public byte[] getEncryptedKeyMaterial();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.security.keystore.recovery.WrappedApplicationKey> CREATOR;
  }

  public static class WrappedApplicationKey.Builder {
    ctor public WrappedApplicationKey.Builder();
    method @NonNull public android.security.keystore.recovery.WrappedApplicationKey build();
    method public android.security.keystore.recovery.WrappedApplicationKey.Builder setAlias(@NonNull String);
    method public android.security.keystore.recovery.WrappedApplicationKey.Builder setEncryptedKeyMaterial(@NonNull byte[]);
  }

}

package android.service.autofill {

  public abstract class AutofillFieldClassificationService extends android.app.Service {
    method public android.os.IBinder onBind(android.content.Intent);
    method @Nullable public float[][] onGetScores(@Nullable String, @Nullable android.os.Bundle, @NonNull java.util.List<android.view.autofill.AutofillValue>, @NonNull java.util.List<java.lang.String>);
    field public static final String SERVICE_INTERFACE = "android.service.autofill.AutofillFieldClassificationService";
    field public static final String SERVICE_META_DATA_KEY_AVAILABLE_ALGORITHMS = "android.autofill.field_classification.available_algorithms";
    field public static final String SERVICE_META_DATA_KEY_DEFAULT_ALGORITHM = "android.autofill.field_classification.default_algorithm";
  }

}

package android.service.carrier {

  public abstract class ApnService extends android.app.Service {
    ctor public ApnService();
    method @NonNull public android.os.IBinder onBind(@Nullable android.content.Intent);
    method @WorkerThread @NonNull public abstract java.util.List<android.content.ContentValues> onRestoreApns(int);
  }

}

package android.service.euicc {

  public final class DownloadSubscriptionResult implements android.os.Parcelable {
    ctor public DownloadSubscriptionResult(int, int, int);
    method public int describeContents();
    method public int getCardId();
    method public int getResolvableErrors();
    method public int getResult();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.euicc.DownloadSubscriptionResult> CREATOR;
  }

  public final class EuiccProfileInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.service.carrier.CarrierIdentifier getCarrierIdentifier();
    method public String getIccid();
    method @Nullable public String getNickname();
    method @android.service.euicc.EuiccProfileInfo.PolicyRule public int getPolicyRules();
    method @android.service.euicc.EuiccProfileInfo.ProfileClass public int getProfileClass();
    method public String getProfileName();
    method public String getServiceProviderName();
    method @android.service.euicc.EuiccProfileInfo.ProfileState public int getState();
    method @Nullable public java.util.List<android.telephony.UiccAccessRule> getUiccAccessRules();
    method public boolean hasPolicyRule(@android.service.euicc.EuiccProfileInfo.PolicyRule int);
    method public boolean hasPolicyRules();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.euicc.EuiccProfileInfo> CREATOR;
    field public static final int POLICY_RULE_DELETE_AFTER_DISABLING = 4; // 0x4
    field public static final int POLICY_RULE_DO_NOT_DELETE = 2; // 0x2
    field public static final int POLICY_RULE_DO_NOT_DISABLE = 1; // 0x1
    field public static final int PROFILE_CLASS_OPERATIONAL = 2; // 0x2
    field public static final int PROFILE_CLASS_PROVISIONING = 1; // 0x1
    field public static final int PROFILE_CLASS_TESTING = 0; // 0x0
    field public static final int PROFILE_STATE_DISABLED = 0; // 0x0
    field public static final int PROFILE_STATE_ENABLED = 1; // 0x1
  }

  public static final class EuiccProfileInfo.Builder {
    ctor public EuiccProfileInfo.Builder(String);
    ctor public EuiccProfileInfo.Builder(android.service.euicc.EuiccProfileInfo);
    method public android.service.euicc.EuiccProfileInfo build();
    method public android.service.euicc.EuiccProfileInfo.Builder setCarrierIdentifier(android.service.carrier.CarrierIdentifier);
    method public android.service.euicc.EuiccProfileInfo.Builder setIccid(String);
    method public android.service.euicc.EuiccProfileInfo.Builder setNickname(String);
    method public android.service.euicc.EuiccProfileInfo.Builder setPolicyRules(@android.service.euicc.EuiccProfileInfo.PolicyRule int);
    method public android.service.euicc.EuiccProfileInfo.Builder setProfileClass(@android.service.euicc.EuiccProfileInfo.ProfileClass int);
    method public android.service.euicc.EuiccProfileInfo.Builder setProfileName(String);
    method public android.service.euicc.EuiccProfileInfo.Builder setServiceProviderName(String);
    method public android.service.euicc.EuiccProfileInfo.Builder setState(@android.service.euicc.EuiccProfileInfo.ProfileState int);
    method public android.service.euicc.EuiccProfileInfo.Builder setUiccAccessRule(@Nullable java.util.List<android.telephony.UiccAccessRule>);
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef(flag=true, prefix={"POLICY_RULE_"}, value={android.service.euicc.EuiccProfileInfo.POLICY_RULE_DO_NOT_DISABLE, android.service.euicc.EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE, android.service.euicc.EuiccProfileInfo.POLICY_RULE_DELETE_AFTER_DISABLING}) public static @interface EuiccProfileInfo.PolicyRule {
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef(prefix={"PROFILE_CLASS_"}, value={android.service.euicc.EuiccProfileInfo.PROFILE_CLASS_TESTING, android.service.euicc.EuiccProfileInfo.PROFILE_CLASS_PROVISIONING, android.service.euicc.EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL, 0xffffffff}) public static @interface EuiccProfileInfo.ProfileClass {
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef(prefix={"PROFILE_STATE_"}, value={android.service.euicc.EuiccProfileInfo.PROFILE_STATE_DISABLED, android.service.euicc.EuiccProfileInfo.PROFILE_STATE_ENABLED, 0xffffffff}) public static @interface EuiccProfileInfo.ProfileState {
  }

  public abstract class EuiccService extends android.app.Service {
    ctor public EuiccService();
    method @CallSuper public android.os.IBinder onBind(android.content.Intent);
    method public abstract int onDeleteSubscription(int, String);
    method public abstract android.service.euicc.DownloadSubscriptionResult onDownloadSubscription(int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean, @Nullable android.os.Bundle);
    method @Deprecated public int onDownloadSubscription(int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean);
    method public abstract int onEraseSubscriptions(int);
    method public abstract android.service.euicc.GetDefaultDownloadableSubscriptionListResult onGetDefaultDownloadableSubscriptionList(int, boolean);
    method public abstract android.service.euicc.GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(int, android.telephony.euicc.DownloadableSubscription, boolean);
    method public abstract String onGetEid(int);
    method @NonNull public abstract android.telephony.euicc.EuiccInfo onGetEuiccInfo(int);
    method @NonNull public abstract android.service.euicc.GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int);
    method @android.telephony.euicc.EuiccManager.OtaStatus public abstract int onGetOtaStatus(int);
    method public abstract int onRetainSubscriptionsForFactoryReset(int);
    method public abstract void onStartOtaIfNecessary(int, android.service.euicc.EuiccService.OtaStatusChangedCallback);
    method public abstract int onSwitchToSubscription(int, @Nullable String, boolean);
    method public abstract int onUpdateSubscriptionNickname(int, String, String);
    field public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
    field public static final String ACTION_MANAGE_EMBEDDED_SUBSCRIPTIONS = "android.service.euicc.action.MANAGE_EMBEDDED_SUBSCRIPTIONS";
    field public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION = "android.service.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
    field public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
    field @Deprecated public static final String ACTION_RESOLVE_CONFIRMATION_CODE = "android.service.euicc.action.RESOLVE_CONFIRMATION_CODE";
    field public static final String ACTION_RESOLVE_DEACTIVATE_SIM = "android.service.euicc.action.RESOLVE_DEACTIVATE_SIM";
    field public static final String ACTION_RESOLVE_NO_PRIVILEGES = "android.service.euicc.action.RESOLVE_NO_PRIVILEGES";
    field public static final String ACTION_RESOLVE_RESOLVABLE_ERRORS = "android.service.euicc.action.RESOLVE_RESOLVABLE_ERRORS";
    field public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED = "android.service.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
    field public static final String CATEGORY_EUICC_UI = "android.service.euicc.category.EUICC_UI";
    field public static final String EUICC_SERVICE_INTERFACE = "android.service.euicc.EuiccService";
    field public static final String EXTRA_RESOLUTION_ALLOW_POLICY_RULES = "android.service.euicc.extra.RESOLUTION_ALLOW_POLICY_RULES";
    field public static final String EXTRA_RESOLUTION_CALLING_PACKAGE = "android.service.euicc.extra.RESOLUTION_CALLING_PACKAGE";
    field public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE = "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE";
    field public static final String EXTRA_RESOLUTION_CONFIRMATION_CODE_RETRIED = "android.service.euicc.extra.RESOLUTION_CONFIRMATION_CODE_RETRIED";
    field public static final String EXTRA_RESOLUTION_CONSENT = "android.service.euicc.extra.RESOLUTION_CONSENT";
    field public static final String EXTRA_RESOLVABLE_ERRORS = "android.service.euicc.extra.RESOLVABLE_ERRORS";
    field public static final int RESOLVABLE_ERROR_CONFIRMATION_CODE = 1; // 0x1
    field public static final int RESOLVABLE_ERROR_POLICY_RULES = 2; // 0x2
    field public static final int RESULT_FIRST_USER = 1; // 0x1
    field public static final int RESULT_MUST_DEACTIVATE_SIM = -1; // 0xffffffff
    field @Deprecated public static final int RESULT_NEED_CONFIRMATION_CODE = -2; // 0xfffffffe
    field public static final int RESULT_OK = 0; // 0x0
    field public static final int RESULT_RESOLVABLE_ERRORS = -2; // 0xfffffffe
  }

  public abstract static class EuiccService.OtaStatusChangedCallback {
    ctor public EuiccService.OtaStatusChangedCallback();
    method public abstract void onOtaStatusChanged(int);
  }

  public final class GetDefaultDownloadableSubscriptionListResult implements android.os.Parcelable {
    ctor public GetDefaultDownloadableSubscriptionListResult(int, @Nullable android.telephony.euicc.DownloadableSubscription[]);
    method public int describeContents();
    method @Nullable public java.util.List<android.telephony.euicc.DownloadableSubscription> getDownloadableSubscriptions();
    method public int getResult();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.euicc.GetDefaultDownloadableSubscriptionListResult> CREATOR;
  }

  public final class GetDownloadableSubscriptionMetadataResult implements android.os.Parcelable {
    ctor public GetDownloadableSubscriptionMetadataResult(int, @Nullable android.telephony.euicc.DownloadableSubscription);
    method public int describeContents();
    method @Nullable public android.telephony.euicc.DownloadableSubscription getDownloadableSubscription();
    method public int getResult();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.euicc.GetDownloadableSubscriptionMetadataResult> CREATOR;
  }

  public final class GetEuiccProfileInfoListResult implements android.os.Parcelable {
    ctor public GetEuiccProfileInfoListResult(int, @Nullable android.service.euicc.EuiccProfileInfo[], boolean);
    method public int describeContents();
    method public boolean getIsRemovable();
    method @Nullable public java.util.List<android.service.euicc.EuiccProfileInfo> getProfiles();
    method public int getResult();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.euicc.GetEuiccProfileInfoListResult> CREATOR;
  }

}

package android.service.notification {

  public final class Adjustment implements android.os.Parcelable {
    ctor public Adjustment(String, String, android.os.Bundle, CharSequence, int);
    ctor protected Adjustment(android.os.Parcel);
    method public int describeContents();
    method public CharSequence getExplanation();
    method public String getKey();
    method public String getPackage();
    method public android.os.Bundle getSignals();
    method public int getUser();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.notification.Adjustment> CREATOR;
    field public static final String KEY_PEOPLE = "key_people";
    field public static final String KEY_SNOOZE_CRITERIA = "key_snooze_criteria";
    field public static final String KEY_USER_SENTIMENT = "key_user_sentiment";
  }

  public abstract class NotificationAssistantService extends android.service.notification.NotificationListenerService {
    ctor public NotificationAssistantService();
    method public final void adjustNotification(android.service.notification.Adjustment);
    method public final void adjustNotifications(java.util.List<android.service.notification.Adjustment>);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract android.service.notification.Adjustment onNotificationEnqueued(android.service.notification.StatusBarNotification);
    method public void onNotificationRemoved(android.service.notification.StatusBarNotification, android.service.notification.NotificationListenerService.RankingMap, android.service.notification.NotificationStats, int);
    method public abstract void onNotificationSnoozedUntilContext(android.service.notification.StatusBarNotification, String);
    method public final void unsnoozeNotification(String);
    field public static final String SERVICE_INTERFACE = "android.service.notification.NotificationAssistantService";
  }

  public final class NotificationStats implements android.os.Parcelable {
    ctor public NotificationStats();
    ctor protected NotificationStats(android.os.Parcel);
    method public int describeContents();
    method public int getDismissalSurface();
    method public boolean hasDirectReplied();
    method public boolean hasExpanded();
    method public boolean hasInteracted();
    method public boolean hasSeen();
    method public boolean hasSnoozed();
    method public boolean hasViewedSettings();
    method public void setDirectReplied();
    method public void setDismissalSurface(int);
    method public void setExpanded();
    method public void setSeen();
    method public void setSnoozed();
    method public void setViewedSettings();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.notification.NotificationStats> CREATOR;
    field public static final int DISMISSAL_AOD = 2; // 0x2
    field public static final int DISMISSAL_NOT_DISMISSED = -1; // 0xffffffff
    field public static final int DISMISSAL_OTHER = 0; // 0x0
    field public static final int DISMISSAL_PEEK = 1; // 0x1
    field public static final int DISMISSAL_SHADE = 3; // 0x3
  }

  public final class SnoozeCriterion implements android.os.Parcelable {
    ctor public SnoozeCriterion(String, CharSequence, CharSequence);
    ctor protected SnoozeCriterion(android.os.Parcel);
    method public int describeContents();
    method public CharSequence getConfirmation();
    method public CharSequence getExplanation();
    method public String getId();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.notification.SnoozeCriterion> CREATOR;
  }

}

package android.service.oemlock {

  public class OemLockManager {
    method @RequiresPermission(android.Manifest.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE) public boolean isOemUnlockAllowedByCarrier();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USER_OEM_UNLOCK_STATE) public boolean isOemUnlockAllowedByUser();
    method @RequiresPermission(android.Manifest.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE) public void setOemUnlockAllowedByCarrier(boolean, @Nullable byte[]);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USER_OEM_UNLOCK_STATE) public void setOemUnlockAllowedByUser(boolean);
  }

}

package android.service.persistentdata {

  public class PersistentDataBlockManager {
    method @RequiresPermission("android.permission.ACCESS_PDB_STATE") public int getDataBlockSize();
    method @RequiresPermission(anyOf={android.Manifest.permission.READ_OEM_UNLOCK_STATE, "android.permission.OEM_UNLOCK_STATE"}) @android.service.persistentdata.PersistentDataBlockManager.FlashLockState public int getFlashLockState();
    method public long getMaximumDataBlockSize();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_OEM_UNLOCK_STATE, "android.permission.OEM_UNLOCK_STATE"}) public boolean getOemUnlockEnabled();
    method public byte[] read();
    method @Deprecated @RequiresPermission("android.permission.OEM_UNLOCK_STATE") public void setOemUnlockEnabled(boolean);
    method @RequiresPermission("android.permission.OEM_UNLOCK_STATE") public void wipe();
    method public int write(byte[]);
    field public static final int FLASH_LOCK_LOCKED = 1; // 0x1
    field public static final int FLASH_LOCK_UNKNOWN = -1; // 0xffffffff
    field public static final int FLASH_LOCK_UNLOCKED = 0; // 0x0
  }

  @IntDef(prefix={"FLASH_LOCK_"}, value={android.service.persistentdata.PersistentDataBlockManager.FLASH_LOCK_UNKNOWN, android.service.persistentdata.PersistentDataBlockManager.FLASH_LOCK_LOCKED, android.service.persistentdata.PersistentDataBlockManager.FLASH_LOCK_UNLOCKED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PersistentDataBlockManager.FlashLockState {
  }

}

package android.service.quicksettings {

  public class TileService extends android.app.Service {
    method public final void setStatusIcon(android.graphics.drawable.Icon, String);
  }

}

package android.service.resolver {

  public abstract class ResolverRankerService extends android.app.Service {
    ctor public ResolverRankerService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public void onPredictSharingProbabilities(java.util.List<android.service.resolver.ResolverTarget>);
    method public void onTrainRankingModel(java.util.List<android.service.resolver.ResolverTarget>, int);
    field public static final String BIND_PERMISSION = "android.permission.BIND_RESOLVER_RANKER_SERVICE";
    field public static final String HOLD_PERMISSION = "android.permission.PROVIDE_RESOLVER_RANKER_SERVICE";
    field public static final String SERVICE_INTERFACE = "android.service.resolver.ResolverRankerService";
  }

  public final class ResolverTarget implements android.os.Parcelable {
    ctor public ResolverTarget();
    method public int describeContents();
    method public float getChooserScore();
    method public float getLaunchScore();
    method public float getRecencyScore();
    method public float getSelectProbability();
    method public float getTimeSpentScore();
    method public void setChooserScore(float);
    method public void setLaunchScore(float);
    method public void setRecencyScore(float);
    method public void setSelectProbability(float);
    method public void setTimeSpentScore(float);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.resolver.ResolverTarget> CREATOR;
  }

}

package android.service.settings.suggestions {

  public final class Suggestion implements android.os.Parcelable {
    method public int describeContents();
    method public int getFlags();
    method public android.graphics.drawable.Icon getIcon();
    method public String getId();
    method public android.app.PendingIntent getPendingIntent();
    method public CharSequence getSummary();
    method public CharSequence getTitle();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.settings.suggestions.Suggestion> CREATOR;
    field public static final int FLAG_HAS_BUTTON = 1; // 0x1
  }

  public static class Suggestion.Builder {
    ctor public Suggestion.Builder(String);
    method public android.service.settings.suggestions.Suggestion build();
    method public android.service.settings.suggestions.Suggestion.Builder setFlags(int);
    method public android.service.settings.suggestions.Suggestion.Builder setIcon(android.graphics.drawable.Icon);
    method public android.service.settings.suggestions.Suggestion.Builder setPendingIntent(android.app.PendingIntent);
    method public android.service.settings.suggestions.Suggestion.Builder setSummary(CharSequence);
    method public android.service.settings.suggestions.Suggestion.Builder setTitle(CharSequence);
  }

  public abstract class SuggestionService extends android.app.Service {
    ctor public SuggestionService();
    method public android.os.IBinder onBind(android.content.Intent);
    method public abstract java.util.List<android.service.settings.suggestions.Suggestion> onGetSuggestions();
    method public abstract void onSuggestionDismissed(android.service.settings.suggestions.Suggestion);
    method public abstract void onSuggestionLaunched(android.service.settings.suggestions.Suggestion);
  }

}

package android.service.textclassifier {

  public abstract class TextClassifierService extends android.app.Service {
    ctor public TextClassifierService();
    method public final android.view.textclassifier.TextClassifier getLocalTextClassifier();
    method @Nullable public final android.os.IBinder onBind(android.content.Intent);
    method public abstract void onClassifyText(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextClassification.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.TextClassification>);
    method public void onCreateTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationContext, @NonNull android.view.textclassifier.TextClassificationSessionId);
    method public void onDestroyTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationSessionId);
    method public abstract void onGenerateLinks(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextLinks.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.TextLinks>);
    method public void onSelectionEvent(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.SelectionEvent);
    method public abstract void onSuggestSelection(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextSelection.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.TextSelection>);
    field public static final String SERVICE_INTERFACE = "android.service.textclassifier.TextClassifierService";
  }

  public static interface TextClassifierService.Callback<T> {
    method public void onFailure(CharSequence);
    method public void onSuccess(T);
  }

}

package android.service.trust {

  public class TrustAgentService extends android.app.Service {
    ctor public TrustAgentService();
    method public final void addEscrowToken(byte[], android.os.UserHandle);
    method @Deprecated public final void grantTrust(CharSequence, long, boolean);
    method public final void grantTrust(CharSequence, long, int);
    method public final void isEscrowTokenActive(long, android.os.UserHandle);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public boolean onConfigure(java.util.List<android.os.PersistableBundle>);
    method public void onDeviceLocked();
    method public void onDeviceUnlockLockout(long);
    method public void onDeviceUnlocked();
    method public void onEscrowTokenAdded(byte[], long, android.os.UserHandle);
    method public void onEscrowTokenRemoved(long, boolean);
    method public void onEscrowTokenStateReceived(long, int);
    method public void onTrustTimeout();
    method public void onUnlockAttempt(boolean);
    method public final void removeEscrowToken(long, android.os.UserHandle);
    method public final void revokeTrust();
    method public final void setManagingTrust(boolean);
    method public final void showKeyguardErrorMessage(@NonNull CharSequence);
    method public final void unlockUserWithToken(long, byte[], android.os.UserHandle);
    field public static final int FLAG_GRANT_TRUST_DISMISS_KEYGUARD = 2; // 0x2
    field public static final int FLAG_GRANT_TRUST_INITIATED_BY_USER = 1; // 0x1
    field public static final String SERVICE_INTERFACE = "android.service.trust.TrustAgentService";
    field public static final int TOKEN_STATE_ACTIVE = 1; // 0x1
    field public static final int TOKEN_STATE_INACTIVE = 0; // 0x0
    field public static final String TRUST_AGENT_META_DATA = "android.service.trust.trustagent";
  }

}

package android.telecom {

  @Deprecated public class AudioState implements android.os.Parcelable {
    ctor @Deprecated public AudioState(boolean, int, int);
    ctor @Deprecated public AudioState(android.telecom.AudioState);
    ctor @Deprecated public AudioState(android.telecom.CallAudioState);
    method @Deprecated public static String audioRouteToString(int);
    method @Deprecated public int describeContents();
    method @Deprecated public int getRoute();
    method @Deprecated public int getSupportedRouteMask();
    method @Deprecated public boolean isMuted();
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated public static final android.os.Parcelable.Creator<android.telecom.AudioState> CREATOR;
    field @Deprecated public static final int ROUTE_BLUETOOTH = 2; // 0x2
    field @Deprecated public static final int ROUTE_EARPIECE = 1; // 0x1
    field @Deprecated public static final int ROUTE_SPEAKER = 8; // 0x8
    field @Deprecated public static final int ROUTE_WIRED_HEADSET = 4; // 0x4
    field @Deprecated public static final int ROUTE_WIRED_OR_EARPIECE = 5; // 0x5
  }

  public final class Call {
    method @Deprecated public void addListener(android.telecom.Call.Listener);
    method @Deprecated public void removeListener(android.telecom.Call.Listener);
    field @Deprecated public static final int STATE_PRE_DIAL_WAIT = 8; // 0x8
  }

  @Deprecated public abstract static class Call.Listener extends android.telecom.Call.Callback {
    ctor @Deprecated public Call.Listener();
  }

  public abstract class Conference extends android.telecom.Conferenceable {
    method @Deprecated public final android.telecom.AudioState getAudioState();
    method @Deprecated public final long getConnectTimeMillis();
    method public android.telecom.Connection getPrimaryConnection();
    method @Deprecated public void onAudioStateChanged(android.telecom.AudioState);
    method @Deprecated public final void setConnectTimeMillis(long);
  }

  public abstract class Connection extends android.telecom.Conferenceable {
    method @Deprecated public final android.telecom.AudioState getAudioState();
    method @Deprecated public void onAudioStateChanged(android.telecom.AudioState);
  }

  public abstract class InCallService extends android.app.Service {
    method @Deprecated public android.telecom.Phone getPhone();
    method @Deprecated public void onPhoneCreated(android.telecom.Phone);
    method @Deprecated public void onPhoneDestroyed(android.telecom.Phone);
  }

  public class ParcelableCallAnalytics implements android.os.Parcelable {
    ctor public ParcelableCallAnalytics(long, long, int, boolean, boolean, int, int, boolean, String, boolean, java.util.List<android.telecom.ParcelableCallAnalytics.AnalyticsEvent>, java.util.List<android.telecom.ParcelableCallAnalytics.EventTiming>);
    ctor public ParcelableCallAnalytics(android.os.Parcel);
    method public java.util.List<android.telecom.ParcelableCallAnalytics.AnalyticsEvent> analyticsEvents();
    method public int describeContents();
    method public long getCallDurationMillis();
    method public int getCallTechnologies();
    method public int getCallTerminationCode();
    method public int getCallType();
    method public String getConnectionService();
    method public java.util.List<android.telecom.ParcelableCallAnalytics.EventTiming> getEventTimings();
    method public long getStartTimeMillis();
    method public boolean isAdditionalCall();
    method public boolean isCreatedFromExistingConnection();
    method public boolean isEmergencyCall();
    method public boolean isInterrupted();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CALLTYPE_INCOMING = 1; // 0x1
    field public static final int CALLTYPE_OUTGOING = 2; // 0x2
    field public static final int CALLTYPE_UNKNOWN = 0; // 0x0
    field public static final int CDMA_PHONE = 1; // 0x1
    field public static final android.os.Parcelable.Creator<android.telecom.ParcelableCallAnalytics> CREATOR;
    field public static final int GSM_PHONE = 2; // 0x2
    field public static final int IMS_PHONE = 4; // 0x4
    field public static final long MILLIS_IN_1_SECOND = 1000L; // 0x3e8L
    field public static final long MILLIS_IN_5_MINUTES = 300000L; // 0x493e0L
    field public static final int SIP_PHONE = 8; // 0x8
    field public static final int STILL_CONNECTED = -1; // 0xffffffff
    field public static final int THIRD_PARTY_PHONE = 16; // 0x10
  }

  public static final class ParcelableCallAnalytics.AnalyticsEvent implements android.os.Parcelable {
    ctor public ParcelableCallAnalytics.AnalyticsEvent(int, long);
    method public int describeContents();
    method public int getEventName();
    method public long getTimeSinceLastEvent();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int AUDIO_ROUTE_BT = 204; // 0xcc
    field public static final int AUDIO_ROUTE_EARPIECE = 205; // 0xcd
    field public static final int AUDIO_ROUTE_HEADSET = 206; // 0xce
    field public static final int AUDIO_ROUTE_SPEAKER = 207; // 0xcf
    field public static final int BIND_CS = 5; // 0x5
    field public static final int BLOCK_CHECK_FINISHED = 105; // 0x69
    field public static final int BLOCK_CHECK_INITIATED = 104; // 0x68
    field public static final int CONFERENCE_WITH = 300; // 0x12c
    field public static final android.os.Parcelable.Creator<android.telecom.ParcelableCallAnalytics.AnalyticsEvent> CREATOR;
    field public static final int CS_BOUND = 6; // 0x6
    field public static final int DIRECT_TO_VM_FINISHED = 103; // 0x67
    field public static final int DIRECT_TO_VM_INITIATED = 102; // 0x66
    field public static final int FILTERING_COMPLETED = 107; // 0x6b
    field public static final int FILTERING_INITIATED = 106; // 0x6a
    field public static final int FILTERING_TIMED_OUT = 108; // 0x6c
    field public static final int MUTE = 202; // 0xca
    field public static final int REMOTELY_HELD = 402; // 0x192
    field public static final int REMOTELY_UNHELD = 403; // 0x193
    field public static final int REQUEST_ACCEPT = 7; // 0x7
    field public static final int REQUEST_HOLD = 400; // 0x190
    field public static final int REQUEST_PULL = 500; // 0x1f4
    field public static final int REQUEST_REJECT = 8; // 0x8
    field public static final int REQUEST_UNHOLD = 401; // 0x191
    field public static final int SCREENING_COMPLETED = 101; // 0x65
    field public static final int SCREENING_SENT = 100; // 0x64
    field public static final int SET_ACTIVE = 1; // 0x1
    field public static final int SET_DIALING = 4; // 0x4
    field public static final int SET_DISCONNECTED = 2; // 0x2
    field public static final int SET_HOLD = 404; // 0x194
    field public static final int SET_PARENT = 302; // 0x12e
    field public static final int SET_SELECT_PHONE_ACCOUNT = 0; // 0x0
    field public static final int SILENCE = 201; // 0xc9
    field public static final int SKIP_RINGING = 200; // 0xc8
    field public static final int SPLIT_CONFERENCE = 301; // 0x12d
    field public static final int START_CONNECTION = 3; // 0x3
    field public static final int SWAP = 405; // 0x195
    field public static final int UNMUTE = 203; // 0xcb
  }

  public static final class ParcelableCallAnalytics.EventTiming implements android.os.Parcelable {
    ctor public ParcelableCallAnalytics.EventTiming(int, long);
    method public int describeContents();
    method public int getName();
    method public long getTime();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ACCEPT_TIMING = 0; // 0x0
    field public static final int BIND_CS_TIMING = 6; // 0x6
    field public static final int BLOCK_CHECK_FINISHED_TIMING = 9; // 0x9
    field public static final android.os.Parcelable.Creator<android.telecom.ParcelableCallAnalytics.EventTiming> CREATOR;
    field public static final int DIRECT_TO_VM_FINISHED_TIMING = 8; // 0x8
    field public static final int DISCONNECT_TIMING = 2; // 0x2
    field public static final int FILTERING_COMPLETED_TIMING = 10; // 0xa
    field public static final int FILTERING_TIMED_OUT_TIMING = 11; // 0xb
    field public static final int HOLD_TIMING = 3; // 0x3
    field public static final int INVALID = 999999; // 0xf423f
    field public static final int OUTGOING_TIME_TO_DIALING_TIMING = 5; // 0x5
    field public static final int REJECT_TIMING = 1; // 0x1
    field public static final int SCREENING_COMPLETED_TIMING = 7; // 0x7
    field public static final int UNHOLD_TIMING = 4; // 0x4
  }

  @Deprecated public final class Phone {
    method @Deprecated public void addListener(android.telecom.Phone.Listener);
    method @Deprecated public boolean canAddCall();
    method @Deprecated public android.telecom.AudioState getAudioState();
    method @Deprecated public android.telecom.CallAudioState getCallAudioState();
    method @Deprecated public java.util.List<android.telecom.Call> getCalls();
    method @Deprecated public void removeListener(android.telecom.Phone.Listener);
    method @Deprecated public void requestBluetoothAudio(String);
    method @Deprecated public void setAudioRoute(int);
    method @Deprecated public void setMuted(boolean);
  }

  @Deprecated public abstract static class Phone.Listener {
    ctor @Deprecated public Phone.Listener();
    method @Deprecated public void onAudioStateChanged(android.telecom.Phone, android.telecom.AudioState);
    method @Deprecated public void onBringToForeground(android.telecom.Phone, boolean);
    method @Deprecated public void onCallAdded(android.telecom.Phone, android.telecom.Call);
    method @Deprecated public void onCallAudioStateChanged(android.telecom.Phone, android.telecom.CallAudioState);
    method @Deprecated public void onCallRemoved(android.telecom.Phone, android.telecom.Call);
    method @Deprecated public void onCanAddCallChanged(android.telecom.Phone, boolean);
    method @Deprecated public void onSilenceRinger(android.telecom.Phone);
  }

  public final class PhoneAccount implements android.os.Parcelable {
    field public static final int CAPABILITY_MULTI_USER = 32; // 0x20
  }

  public class PhoneAccountSuggestionService extends android.app.Service {
    ctor public PhoneAccountSuggestionService();
    method public void onAccountSuggestionRequest(@NonNull String);
    method public android.os.IBinder onBind(android.content.Intent);
    method public final void suggestPhoneAccounts(@NonNull String, @NonNull java.util.List<android.telecom.PhoneAccountSuggestion>);
    field public static final String SERVICE_INTERFACE = "android.telecom.PhoneAccountSuggestionService";
  }

  public final class RemoteConference {
    method @Deprecated public void setAudioState(android.telecom.AudioState);
  }

  public final class RemoteConnection {
    method @Deprecated public void setAudioState(android.telecom.AudioState);
  }

  public final class StatusHints implements android.os.Parcelable {
    ctor @Deprecated public StatusHints(android.content.ComponentName, CharSequence, int, android.os.Bundle);
    method @Deprecated public android.graphics.drawable.Drawable getIcon(android.content.Context);
    method @Deprecated public int getIconResId();
    method @Deprecated public android.content.ComponentName getPackageName();
  }

  public final class TelecomAnalytics implements android.os.Parcelable {
    ctor public TelecomAnalytics(java.util.List<android.telecom.TelecomAnalytics.SessionTiming>, java.util.List<android.telecom.ParcelableCallAnalytics>);
    method public int describeContents();
    method public java.util.List<android.telecom.ParcelableCallAnalytics> getCallAnalytics();
    method public java.util.List<android.telecom.TelecomAnalytics.SessionTiming> getSessionTimings();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telecom.TelecomAnalytics> CREATOR;
  }

  public static final class TelecomAnalytics.SessionTiming implements android.os.Parcelable {
    ctor public TelecomAnalytics.SessionTiming(int, long);
    method public int describeContents();
    method public Integer getKey();
    method public long getTime();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telecom.TelecomAnalytics.SessionTiming> CREATOR;
    field public static final int CSW_ADD_CONFERENCE_CALL = 108; // 0x6c
    field public static final int CSW_HANDLE_CREATE_CONNECTION_COMPLETE = 100; // 0x64
    field public static final int CSW_REMOVE_CALL = 106; // 0x6a
    field public static final int CSW_SET_ACTIVE = 101; // 0x65
    field public static final int CSW_SET_DIALING = 103; // 0x67
    field public static final int CSW_SET_DISCONNECTED = 104; // 0x68
    field public static final int CSW_SET_IS_CONFERENCED = 107; // 0x6b
    field public static final int CSW_SET_ON_HOLD = 105; // 0x69
    field public static final int CSW_SET_RINGING = 102; // 0x66
    field public static final int ICA_ANSWER_CALL = 1; // 0x1
    field public static final int ICA_CONFERENCE = 8; // 0x8
    field public static final int ICA_DISCONNECT_CALL = 3; // 0x3
    field public static final int ICA_HOLD_CALL = 4; // 0x4
    field public static final int ICA_MUTE = 6; // 0x6
    field public static final int ICA_REJECT_CALL = 2; // 0x2
    field public static final int ICA_SET_AUDIO_ROUTE = 7; // 0x7
    field public static final int ICA_UNHOLD_CALL = 5; // 0x5
  }

  public class TelecomManager {
    method public void addNewUnknownCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
    method @Deprecated public void clearAccounts();
    method public void clearPhoneAccounts();
    method @RequiresPermission(android.Manifest.permission.DUMP) public android.telecom.TelecomAnalytics dumpAnalytics();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void enablePhoneAccount(android.telecom.PhoneAccountHandle, boolean);
    method public java.util.List<android.telecom.PhoneAccountHandle> getAllPhoneAccountHandles();
    method public java.util.List<android.telecom.PhoneAccount> getAllPhoneAccounts();
    method public int getAllPhoneAccountsCount();
    method public int getCallState();
    method public android.telecom.PhoneAccountHandle getConnectionManager();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCurrentTtyMode();
    method @Deprecated public android.content.ComponentName getDefaultPhoneApp();
    method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsForPackage();
    method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsSupportingScheme(String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean isInEmergencyCall();
    method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging();
    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.WRITE_SECURE_SETTINGS}) public boolean setDefaultDialer(@Nullable String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUserSelectedOutgoingPhoneAccount(@Nullable android.telecom.PhoneAccountHandle);
    field public static final String EXTRA_CALL_BACK_INTENT = "android.telecom.extra.CALL_BACK_INTENT";
    field public static final String EXTRA_CLEAR_MISSED_CALLS_INTENT = "android.telecom.extra.CLEAR_MISSED_CALLS_INTENT";
    field public static final String EXTRA_CONNECTION_SERVICE = "android.telecom.extra.CONNECTION_SERVICE";
    field public static final String EXTRA_IS_USER_INTENT_EMERGENCY_CALL = "android.telecom.extra.IS_USER_INTENT_EMERGENCY_CALL";
    field public static final int TTY_MODE_FULL = 1; // 0x1
    field public static final int TTY_MODE_HCO = 2; // 0x2
    field public static final int TTY_MODE_OFF = 0; // 0x0
    field public static final int TTY_MODE_VCO = 3; // 0x3
  }

}

package android.telephony {

  public static final class AccessNetworkConstants.TransportType {
    field public static final int WLAN = 2; // 0x2
    field public static final int WWAN = 1; // 0x1
  }

  public final class CallAttributes implements android.os.Parcelable {
    ctor public CallAttributes(@NonNull android.telephony.PreciseCallState, int, @NonNull android.telephony.CallQuality);
    method public int describeContents();
    method @NonNull public android.telephony.CallQuality getCallQuality();
    method public int getNetworkType();
    method @NonNull public android.telephony.PreciseCallState getPreciseCallState();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
  }

  public final class CallQuality implements android.os.Parcelable {
    ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
    method public int describeContents();
    method public int getAverageRelativeJitter();
    method public int getAverageRoundTripTime();
    method public int getCallDuration();
    method public int getCodecType();
    method public int getDownlinkCallQualityLevel();
    method public int getMaxRelativeJitter();
    method public int getNumRtpPacketsNotReceived();
    method public int getNumRtpPacketsReceived();
    method public int getNumRtpPacketsTransmitted();
    method public int getNumRtpPacketsTransmittedLost();
    method public int getUplinkCallQualityLevel();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CALL_QUALITY_BAD = 4; // 0x4
    field public static final int CALL_QUALITY_EXCELLENT = 0; // 0x0
    field public static final int CALL_QUALITY_FAIR = 2; // 0x2
    field public static final int CALL_QUALITY_GOOD = 1; // 0x1
    field public static final int CALL_QUALITY_NOT_AVAILABLE = 5; // 0x5
    field public static final int CALL_QUALITY_POOR = 3; // 0x3
    field public static final android.os.Parcelable.Creator<android.telephony.CallQuality> CREATOR;
  }

  public class CarrierConfigManager {
    method @NonNull public static android.os.PersistableBundle getDefaultConfig();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void overrideConfig(int, @Nullable android.os.PersistableBundle);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void updateConfigForPhoneId(int, String);
    field public static final String KEY_CARRIER_SETUP_APP_STRING = "carrier_setup_app_string";
  }

  public final class CarrierRestrictionRules implements android.os.Parcelable {
    method @NonNull public java.util.List<java.lang.Boolean> areCarrierIdentifiersAllowed(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
    method public int describeContents();
    method @NonNull public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers();
    method public int getDefaultCarrierRestriction();
    method @NonNull public java.util.List<android.service.carrier.CarrierIdentifier> getExcludedCarriers();
    method public int getMultiSimPolicy();
    method public boolean isAllCarriersAllowed();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CARRIER_RESTRICTION_DEFAULT_ALLOWED = 1; // 0x1
    field public static final int CARRIER_RESTRICTION_DEFAULT_NOT_ALLOWED = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.telephony.CarrierRestrictionRules> CREATOR;
    field public static final int MULTISIM_POLICY_NONE = 0; // 0x0
    field public static final int MULTISIM_POLICY_ONE_VALID_SIM_MUST_BE_PRESENT = 1; // 0x1
  }

  public static final class CarrierRestrictionRules.Builder {
    method @NonNull public android.telephony.CarrierRestrictionRules build();
    method @NonNull public android.telephony.CarrierRestrictionRules.Builder setAllCarriersAllowed();
    method @NonNull public android.telephony.CarrierRestrictionRules.Builder setAllowedCarriers(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
    method @NonNull public android.telephony.CarrierRestrictionRules.Builder setDefaultCarrierRestriction(int);
    method @NonNull public android.telephony.CarrierRestrictionRules.Builder setExcludedCarriers(@NonNull java.util.List<android.service.carrier.CarrierIdentifier>);
    method @NonNull public android.telephony.CarrierRestrictionRules.Builder setMultiSimPolicy(int);
  }

  public final class DataFailCause {
    field public static final int ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 2219; // 0x8ab
    field public static final int ACCESS_BLOCK = 2087; // 0x827
    field public static final int ACCESS_BLOCK_ALL = 2088; // 0x828
    field public static final int ACCESS_CLASS_DSAC_REJECTION = 2108; // 0x83c
    field public static final int ACCESS_CONTROL_LIST_CHECK_FAILURE = 2128; // 0x850
    field public static final int ACTIVATION_REJECTED_BCM_VIOLATION = 48; // 0x30
    field public static final int ACTIVATION_REJECT_GGSN = 30; // 0x1e
    field public static final int ACTIVATION_REJECT_UNSPECIFIED = 31; // 0x1f
    field public static final int ACTIVE_PDP_CONTEXT_MAX_NUMBER_REACHED = 65; // 0x41
    field public static final int APN_DISABLED = 2045; // 0x7fd
    field public static final int APN_DISALLOWED_ON_ROAMING = 2059; // 0x80b
    field public static final int APN_MISMATCH = 2054; // 0x806
    field public static final int APN_PARAMETERS_CHANGED = 2060; // 0x80c
    field public static final int APN_PENDING_HANDOVER = 2041; // 0x7f9
    field public static final int APN_TYPE_CONFLICT = 112; // 0x70
    field public static final int AUTH_FAILURE_ON_EMERGENCY_CALL = 122; // 0x7a
    field public static final int BEARER_HANDLING_NOT_SUPPORTED = 60; // 0x3c
    field public static final int CALL_DISALLOWED_IN_ROAMING = 2068; // 0x814
    field public static final int CALL_PREEMPT_BY_EMERGENCY_APN = 127; // 0x7f
    field public static final int CANNOT_ENCODE_OTA_MESSAGE = 2159; // 0x86f
    field public static final int CDMA_ALERT_STOP = 2077; // 0x81d
    field public static final int CDMA_INCOMING_CALL = 2076; // 0x81c
    field public static final int CDMA_INTERCEPT = 2073; // 0x819
    field public static final int CDMA_LOCK = 2072; // 0x818
    field public static final int CDMA_RELEASE_DUE_TO_SO_REJECTION = 2075; // 0x81b
    field public static final int CDMA_REORDER = 2074; // 0x81a
    field public static final int CDMA_RETRY_ORDER = 2086; // 0x826
    field public static final int CHANNEL_ACQUISITION_FAILURE = 2078; // 0x81e
    field public static final int CLOSE_IN_PROGRESS = 2030; // 0x7ee
    field public static final int COLLISION_WITH_NETWORK_INITIATED_REQUEST = 56; // 0x38
    field public static final int COMPANION_IFACE_IN_USE = 118; // 0x76
    field public static final int CONCURRENT_SERVICES_INCOMPATIBLE = 2083; // 0x823
    field public static final int CONCURRENT_SERVICES_NOT_ALLOWED = 2091; // 0x82b
    field public static final int CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 2080; // 0x820
    field public static final int CONDITIONAL_IE_ERROR = 100; // 0x64
    field public static final int CONGESTION = 2106; // 0x83a
    field public static final int CONNECTION_RELEASED = 2113; // 0x841
    field public static final int CS_DOMAIN_NOT_AVAILABLE = 2181; // 0x885
    field public static final int CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 2188; // 0x88c
    field public static final int DATA_PLAN_EXPIRED = 2198; // 0x896
    field public static final int DATA_ROAMING_SETTINGS_DISABLED = 2064; // 0x810
    field public static final int DATA_SETTINGS_DISABLED = 2063; // 0x80f
    field public static final int DBM_OR_SMS_IN_PROGRESS = 2211; // 0x8a3
    field public static final int DDS_SWITCHED = 2065; // 0x811
    field public static final int DDS_SWITCH_IN_PROGRESS = 2067; // 0x813
    field public static final int DRB_RELEASED_BY_RRC = 2112; // 0x840
    field public static final int DS_EXPLICIT_DEACTIVATION = 2125; // 0x84d
    field public static final int DUAL_SWITCH = 2227; // 0x8b3
    field public static final int DUN_CALL_DISALLOWED = 2056; // 0x808
    field public static final int DUPLICATE_BEARER_ID = 2118; // 0x846
    field public static final int EHRPD_TO_HRPD_FALLBACK = 2049; // 0x801
    field public static final int EMBMS_NOT_ENABLED = 2193; // 0x891
    field public static final int EMBMS_REGULAR_DEACTIVATION = 2195; // 0x893
    field public static final int EMERGENCY_IFACE_ONLY = 116; // 0x74
    field public static final int EMERGENCY_MODE = 2221; // 0x8ad
    field public static final int EMM_ACCESS_BARRED = 115; // 0x73
    field public static final int EMM_ACCESS_BARRED_INFINITE_RETRY = 121; // 0x79
    field public static final int EMM_ATTACH_FAILED = 2115; // 0x843
    field public static final int EMM_ATTACH_STARTED = 2116; // 0x844
    field public static final int EMM_DETACHED = 2114; // 0x842
    field public static final int EMM_T3417_EXPIRED = 2130; // 0x852
    field public static final int EMM_T3417_EXT_EXPIRED = 2131; // 0x853
    field public static final int EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 2178; // 0x882
    field public static final int EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 2179; // 0x883
    field public static final int ERROR_UNSPECIFIED = 65535; // 0xffff
    field public static final int ESM_BAD_OTA_MESSAGE = 2122; // 0x84a
    field public static final int ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 2120; // 0x848
    field public static final int ESM_COLLISION_SCENARIOS = 2119; // 0x847
    field public static final int ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 2124; // 0x84c
    field public static final int ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 2123; // 0x84b
    field public static final int ESM_FAILURE = 2182; // 0x886
    field public static final int ESM_INFO_NOT_RECEIVED = 53; // 0x35
    field public static final int ESM_LOCAL_CAUSE_NONE = 2126; // 0x84e
    field public static final int ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 2121; // 0x849
    field public static final int ESM_PROCEDURE_TIME_OUT = 2155; // 0x86b
    field public static final int ESM_UNKNOWN_EPS_BEARER_CONTEXT = 2111; // 0x83f
    field public static final int EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 2201; // 0x899
    field public static final int EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 2200; // 0x898
    field public static final int EVDO_HDR_CHANGED = 2202; // 0x89a
    field public static final int EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 2206; // 0x89e
    field public static final int EVDO_HDR_EXITED = 2203; // 0x89b
    field public static final int EVDO_HDR_NO_SESSION = 2204; // 0x89c
    field public static final int EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 2205; // 0x89d
    field public static final int FADE = 2217; // 0x8a9
    field public static final int FAILED_TO_ACQUIRE_COLOCATED_HDR = 2207; // 0x89f
    field public static final int FEATURE_NOT_SUPP = 40; // 0x28
    field public static final int FILTER_SEMANTIC_ERROR = 44; // 0x2c
    field public static final int FILTER_SYTAX_ERROR = 45; // 0x2d
    field public static final int FORBIDDEN_APN_NAME = 2066; // 0x812
    field public static final int GPRS_REGISTRATION_FAIL = -2; // 0xfffffffe
    field public static final int GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 2097; // 0x831
    field public static final int GPRS_SERVICES_NOT_ALLOWED = 2098; // 0x832
    field public static final int GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 2103; // 0x837
    field public static final int HANDOFF_PREFERENCE_CHANGED = 2251; // 0x8cb
    field public static final int HDR_ACCESS_FAILURE = 2213; // 0x8a5
    field public static final int HDR_FADE = 2212; // 0x8a4
    field public static final int HDR_NO_LOCK_GRANTED = 2210; // 0x8a2
    field public static final int IFACE_AND_POL_FAMILY_MISMATCH = 120; // 0x78
    field public static final int IFACE_MISMATCH = 117; // 0x75
    field public static final int ILLEGAL_ME = 2096; // 0x830
    field public static final int ILLEGAL_MS = 2095; // 0x82f
    field public static final int IMEI_NOT_ACCEPTED = 2177; // 0x881
    field public static final int IMPLICITLY_DETACHED = 2100; // 0x834
    field public static final int IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 2176; // 0x880
    field public static final int INCOMING_CALL_REJECTED = 2092; // 0x82c
    field public static final int INSUFFICIENT_RESOURCES = 26; // 0x1a
    field public static final int INTERFACE_IN_USE = 2058; // 0x80a
    field public static final int INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 114; // 0x72
    field public static final int INTERNAL_EPC_NONEPC_TRANSITION = 2057; // 0x809
    field public static final int INVALID_CONNECTION_ID = 2156; // 0x86c
    field public static final int INVALID_DNS_ADDR = 123; // 0x7b
    field public static final int INVALID_EMM_STATE = 2190; // 0x88e
    field public static final int INVALID_MANDATORY_INFO = 96; // 0x60
    field public static final int INVALID_MODE = 2223; // 0x8af
    field public static final int INVALID_PCSCF_ADDR = 113; // 0x71
    field public static final int INVALID_PCSCF_OR_DNS_ADDRESS = 124; // 0x7c
    field public static final int INVALID_PRIMARY_NSAPI = 2158; // 0x86e
    field public static final int INVALID_SIM_STATE = 2224; // 0x8b0
    field public static final int INVALID_TRANSACTION_ID = 81; // 0x51
    field public static final int IPV6_ADDRESS_TRANSFER_FAILED = 2047; // 0x7ff
    field public static final int IPV6_PREFIX_UNAVAILABLE = 2250; // 0x8ca
    field public static final int IP_ADDRESS_MISMATCH = 119; // 0x77
    field public static final int IP_VERSION_MISMATCH = 2055; // 0x807
    field public static final int IRAT_HANDOVER_FAILED = 2194; // 0x892
    field public static final int IS707B_MAX_ACCESS_PROBES = 2089; // 0x829
    field public static final int LIMITED_TO_IPV4 = 2234; // 0x8ba
    field public static final int LIMITED_TO_IPV6 = 2235; // 0x8bb
    field public static final int LLC_SNDCP = 25; // 0x19
    field public static final int LOCAL_END = 2215; // 0x8a7
    field public static final int LOCATION_AREA_NOT_ALLOWED = 2102; // 0x836
    field public static final int LOST_CONNECTION = 65540; // 0x10004
    field public static final int LOWER_LAYER_REGISTRATION_FAILURE = 2197; // 0x895
    field public static final int LOW_POWER_MODE_OR_POWERING_DOWN = 2044; // 0x7fc
    field public static final int LTE_NAS_SERVICE_REQUEST_FAILED = 2117; // 0x845
    field public static final int LTE_THROTTLING_NOT_REQUIRED = 2127; // 0x84f
    field public static final int MAC_FAILURE = 2183; // 0x887
    field public static final int MAXIMIUM_NSAPIS_EXCEEDED = 2157; // 0x86d
    field public static final int MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 2166; // 0x876
    field public static final int MAX_ACCESS_PROBE = 2079; // 0x81f
    field public static final int MAX_IPV4_CONNECTIONS = 2052; // 0x804
    field public static final int MAX_IPV6_CONNECTIONS = 2053; // 0x805
    field public static final int MAX_PPP_INACTIVITY_TIMER_EXPIRED = 2046; // 0x7fe
    field public static final int MESSAGE_INCORRECT_SEMANTIC = 95; // 0x5f
    field public static final int MESSAGE_TYPE_UNSUPPORTED = 97; // 0x61
    field public static final int MIP_CONFIG_FAILURE = 2050; // 0x802
    field public static final int MIP_FA_ADMIN_PROHIBITED = 2001; // 0x7d1
    field public static final int MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 2012; // 0x7dc
    field public static final int MIP_FA_ENCAPSULATION_UNAVAILABLE = 2008; // 0x7d8
    field public static final int MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 2004; // 0x7d4
    field public static final int MIP_FA_INSUFFICIENT_RESOURCES = 2002; // 0x7d2
    field public static final int MIP_FA_MALFORMED_REPLY = 2007; // 0x7d7
    field public static final int MIP_FA_MALFORMED_REQUEST = 2006; // 0x7d6
    field public static final int MIP_FA_MISSING_CHALLENGE = 2017; // 0x7e1
    field public static final int MIP_FA_MISSING_HOME_ADDRESS = 2015; // 0x7df
    field public static final int MIP_FA_MISSING_HOME_AGENT = 2014; // 0x7de
    field public static final int MIP_FA_MISSING_NAI = 2013; // 0x7dd
    field public static final int MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2003; // 0x7d3
    field public static final int MIP_FA_REASON_UNSPECIFIED = 2000; // 0x7d0
    field public static final int MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 2005; // 0x7d5
    field public static final int MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 2011; // 0x7db
    field public static final int MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 2010; // 0x7da
    field public static final int MIP_FA_STALE_CHALLENGE = 2018; // 0x7e2
    field public static final int MIP_FA_UNKNOWN_CHALLENGE = 2016; // 0x7e0
    field public static final int MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 2009; // 0x7d9
    field public static final int MIP_HA_ADMIN_PROHIBITED = 2020; // 0x7e4
    field public static final int MIP_HA_ENCAPSULATION_UNAVAILABLE = 2029; // 0x7ed
    field public static final int MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 2023; // 0x7e7
    field public static final int MIP_HA_INSUFFICIENT_RESOURCES = 2021; // 0x7e5
    field public static final int MIP_HA_MALFORMED_REQUEST = 2025; // 0x7e9
    field public static final int MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2022; // 0x7e6
    field public static final int MIP_HA_REASON_UNSPECIFIED = 2019; // 0x7e3
    field public static final int MIP_HA_REGISTRATION_ID_MISMATCH = 2024; // 0x7e8
    field public static final int MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 2028; // 0x7ec
    field public static final int MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 2027; // 0x7eb
    field public static final int MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 2026; // 0x7ea
    field public static final int MISSING_UNKNOWN_APN = 27; // 0x1b
    field public static final int MODEM_APP_PREEMPTED = 2032; // 0x7f0
    field public static final int MODEM_RESTART = 2037; // 0x7f5
    field public static final int MSC_TEMPORARILY_NOT_REACHABLE = 2180; // 0x884
    field public static final int MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 101; // 0x65
    field public static final int MSG_TYPE_NONCOMPATIBLE_STATE = 98; // 0x62
    field public static final int MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 2099; // 0x833
    field public static final int MULTIPLE_PDP_CALL_NOT_ALLOWED = 2192; // 0x890
    field public static final int MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 55; // 0x37
    field public static final int NAS_LAYER_FAILURE = 2191; // 0x88f
    field public static final int NAS_REQUEST_REJECTED_BY_NETWORK = 2167; // 0x877
    field public static final int NAS_SIGNALLING = 14; // 0xe
    field public static final int NETWORK_FAILURE = 38; // 0x26
    field public static final int NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 2154; // 0x86a
    field public static final int NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 2153; // 0x869
    field public static final int NETWORK_INITIATED_TERMINATION = 2031; // 0x7ef
    field public static final int NONE = 0; // 0x0
    field public static final int NON_IP_NOT_SUPPORTED = 2069; // 0x815
    field public static final int NORMAL_RELEASE = 2218; // 0x8aa
    field public static final int NO_CDMA_SERVICE = 2084; // 0x824
    field public static final int NO_COLLOCATED_HDR = 2225; // 0x8b1
    field public static final int NO_EPS_BEARER_CONTEXT_ACTIVATED = 2189; // 0x88d
    field public static final int NO_GPRS_CONTEXT = 2094; // 0x82e
    field public static final int NO_HYBRID_HDR_SERVICE = 2209; // 0x8a1
    field public static final int NO_PDP_CONTEXT_ACTIVATED = 2107; // 0x83b
    field public static final int NO_RESPONSE_FROM_BASE_STATION = 2081; // 0x821
    field public static final int NO_SERVICE = 2216; // 0x8a8
    field public static final int NO_SERVICE_ON_GATEWAY = 2093; // 0x82d
    field public static final int NSAPI_IN_USE = 35; // 0x23
    field public static final int NULL_APN_DISALLOWED = 2061; // 0x80d
    field public static final int OEM_DCFAILCAUSE_1 = 4097; // 0x1001
    field public static final int OEM_DCFAILCAUSE_10 = 4106; // 0x100a
    field public static final int OEM_DCFAILCAUSE_11 = 4107; // 0x100b
    field public static final int OEM_DCFAILCAUSE_12 = 4108; // 0x100c
    field public static final int OEM_DCFAILCAUSE_13 = 4109; // 0x100d
    field public static final int OEM_DCFAILCAUSE_14 = 4110; // 0x100e
    field public static final int OEM_DCFAILCAUSE_15 = 4111; // 0x100f
    field public static final int OEM_DCFAILCAUSE_2 = 4098; // 0x1002
    field public static final int OEM_DCFAILCAUSE_3 = 4099; // 0x1003
    field public static final int OEM_DCFAILCAUSE_4 = 4100; // 0x1004
    field public static final int OEM_DCFAILCAUSE_5 = 4101; // 0x1005
    field public static final int OEM_DCFAILCAUSE_6 = 4102; // 0x1006
    field public static final int OEM_DCFAILCAUSE_7 = 4103; // 0x1007
    field public static final int OEM_DCFAILCAUSE_8 = 4104; // 0x1008
    field public static final int OEM_DCFAILCAUSE_9 = 4105; // 0x1009
    field public static final int ONLY_IPV4V6_ALLOWED = 57; // 0x39
    field public static final int ONLY_IPV4_ALLOWED = 50; // 0x32
    field public static final int ONLY_IPV6_ALLOWED = 51; // 0x33
    field public static final int ONLY_NON_IP_ALLOWED = 58; // 0x3a
    field public static final int ONLY_SINGLE_BEARER_ALLOWED = 52; // 0x34
    field public static final int OPERATOR_BARRED = 8; // 0x8
    field public static final int OTASP_COMMIT_IN_PROGRESS = 2208; // 0x8a0
    field public static final int PDN_CONN_DOES_NOT_EXIST = 54; // 0x36
    field public static final int PDN_INACTIVITY_TIMER_EXPIRED = 2051; // 0x803
    field public static final int PDN_IPV4_CALL_DISALLOWED = 2033; // 0x7f1
    field public static final int PDN_IPV4_CALL_THROTTLED = 2034; // 0x7f2
    field public static final int PDN_IPV6_CALL_DISALLOWED = 2035; // 0x7f3
    field public static final int PDN_IPV6_CALL_THROTTLED = 2036; // 0x7f4
    field public static final int PDN_NON_IP_CALL_DISALLOWED = 2071; // 0x817
    field public static final int PDN_NON_IP_CALL_THROTTLED = 2070; // 0x816
    field public static final int PDP_ACTIVATE_MAX_RETRY_FAILED = 2109; // 0x83d
    field public static final int PDP_DUPLICATE = 2104; // 0x838
    field public static final int PDP_ESTABLISH_TIMEOUT_EXPIRED = 2161; // 0x871
    field public static final int PDP_INACTIVE_TIMEOUT_EXPIRED = 2163; // 0x873
    field public static final int PDP_LOWERLAYER_ERROR = 2164; // 0x874
    field public static final int PDP_MODIFY_COLLISION = 2165; // 0x875
    field public static final int PDP_MODIFY_TIMEOUT_EXPIRED = 2162; // 0x872
    field public static final int PDP_PPP_NOT_SUPPORTED = 2038; // 0x7f6
    field public static final int PDP_WITHOUT_ACTIVE_TFT = 46; // 0x2e
    field public static final int PHONE_IN_USE = 2222; // 0x8ae
    field public static final int PHYSICAL_LINK_CLOSE_IN_PROGRESS = 2040; // 0x7f8
    field public static final int PLMN_NOT_ALLOWED = 2101; // 0x835
    field public static final int PPP_AUTH_FAILURE = 2229; // 0x8b5
    field public static final int PPP_CHAP_FAILURE = 2232; // 0x8b8
    field public static final int PPP_CLOSE_IN_PROGRESS = 2233; // 0x8b9
    field public static final int PPP_OPTION_MISMATCH = 2230; // 0x8b6
    field public static final int PPP_PAP_FAILURE = 2231; // 0x8b7
    field public static final int PPP_TIMEOUT = 2228; // 0x8b4
    field public static final int PREF_RADIO_TECH_CHANGED = -4; // 0xfffffffc
    field public static final int PROFILE_BEARER_INCOMPATIBLE = 2042; // 0x7fa
    field public static final int PROTOCOL_ERRORS = 111; // 0x6f
    field public static final int QOS_NOT_ACCEPTED = 37; // 0x25
    field public static final int RADIO_ACCESS_BEARER_FAILURE = 2110; // 0x83e
    field public static final int RADIO_ACCESS_BEARER_SETUP_FAILURE = 2160; // 0x870
    field public static final int RADIO_NOT_AVAILABLE = 65537; // 0x10001
    field public static final int RADIO_POWER_OFF = -5; // 0xfffffffb
    field public static final int REDIRECTION_OR_HANDOFF_IN_PROGRESS = 2220; // 0x8ac
    field public static final int REGISTRATION_FAIL = -1; // 0xffffffff
    field public static final int REGULAR_DEACTIVATION = 36; // 0x24
    field public static final int REJECTED_BY_BASE_STATION = 2082; // 0x822
    field public static final int RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 2173; // 0x87d
    field public static final int RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 2174; // 0x87e
    field public static final int RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 2171; // 0x87b
    field public static final int RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 2175; // 0x87f
    field public static final int RRC_CONNECTION_ABORT_REQUEST = 2151; // 0x867
    field public static final int RRC_CONNECTION_ACCESS_BARRED = 2139; // 0x85b
    field public static final int RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 2137; // 0x859
    field public static final int RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 2138; // 0x85a
    field public static final int RRC_CONNECTION_CELL_NOT_CAMPED = 2144; // 0x860
    field public static final int RRC_CONNECTION_CELL_RESELECTION = 2140; // 0x85c
    field public static final int RRC_CONNECTION_CONFIG_FAILURE = 2141; // 0x85d
    field public static final int RRC_CONNECTION_INVALID_REQUEST = 2168; // 0x878
    field public static final int RRC_CONNECTION_LINK_FAILURE = 2143; // 0x85f
    field public static final int RRC_CONNECTION_NORMAL_RELEASE = 2147; // 0x863
    field public static final int RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 2150; // 0x866
    field public static final int RRC_CONNECTION_RADIO_LINK_FAILURE = 2148; // 0x864
    field public static final int RRC_CONNECTION_REESTABLISHMENT_FAILURE = 2149; // 0x865
    field public static final int RRC_CONNECTION_REJECT_BY_NETWORK = 2146; // 0x862
    field public static final int RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 2172; // 0x87c
    field public static final int RRC_CONNECTION_RF_UNAVAILABLE = 2170; // 0x87a
    field public static final int RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 2152; // 0x868
    field public static final int RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 2145; // 0x861
    field public static final int RRC_CONNECTION_TIMER_EXPIRED = 2142; // 0x85e
    field public static final int RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 2169; // 0x879
    field public static final int RRC_UPLINK_CONNECTION_RELEASE = 2134; // 0x856
    field public static final int RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 2132; // 0x854
    field public static final int RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 2133; // 0x855
    field public static final int RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 2136; // 0x858
    field public static final int RRC_UPLINK_RADIO_LINK_FAILURE = 2135; // 0x857
    field public static final int RUIM_NOT_PRESENT = 2085; // 0x825
    field public static final int SECURITY_MODE_REJECTED = 2186; // 0x88a
    field public static final int SERVICE_NOT_ALLOWED_ON_PLMN = 2129; // 0x851
    field public static final int SERVICE_OPTION_NOT_SUBSCRIBED = 33; // 0x21
    field public static final int SERVICE_OPTION_NOT_SUPPORTED = 32; // 0x20
    field public static final int SERVICE_OPTION_OUT_OF_ORDER = 34; // 0x22
    field public static final int SIGNAL_LOST = -3; // 0xfffffffd
    field public static final int SIM_CARD_CHANGED = 2043; // 0x7fb
    field public static final int SYNCHRONIZATION_FAILURE = 2184; // 0x888
    field public static final int TEST_LOOPBACK_REGULAR_DEACTIVATION = 2196; // 0x894
    field public static final int TETHERED_CALL_ACTIVE = -6; // 0xfffffffa
    field public static final int TFT_SEMANTIC_ERROR = 41; // 0x29
    field public static final int TFT_SYTAX_ERROR = 42; // 0x2a
    field public static final int THERMAL_EMERGENCY = 2090; // 0x82a
    field public static final int THERMAL_MITIGATION = 2062; // 0x80e
    field public static final int TRAT_SWAP_FAILED = 2048; // 0x800
    field public static final int UE_INITIATED_DETACH_OR_DISCONNECT = 128; // 0x80
    field public static final int UE_IS_ENTERING_POWERSAVE_MODE = 2226; // 0x8b2
    field public static final int UE_RAT_CHANGE = 2105; // 0x839
    field public static final int UE_SECURITY_CAPABILITIES_MISMATCH = 2185; // 0x889
    field public static final int UMTS_HANDOVER_TO_IWLAN = 2199; // 0x897
    field public static final int UMTS_REACTIVATION_REQ = 39; // 0x27
    field public static final int UNACCEPTABLE_NON_EPS_AUTHENTICATION = 2187; // 0x88b
    field public static final int UNKNOWN = 65536; // 0x10000
    field public static final int UNKNOWN_INFO_ELEMENT = 99; // 0x63
    field public static final int UNKNOWN_PDP_ADDRESS_TYPE = 28; // 0x1c
    field public static final int UNKNOWN_PDP_CONTEXT = 43; // 0x2b
    field public static final int UNPREFERRED_RAT = 2039; // 0x7f7
    field public static final int UNSUPPORTED_1X_PREV = 2214; // 0x8a6
    field public static final int UNSUPPORTED_APN_IN_CURRENT_PLMN = 66; // 0x42
    field public static final int UNSUPPORTED_QCI_VALUE = 59; // 0x3b
    field public static final int USER_AUTHENTICATION = 29; // 0x1d
    field public static final int VSNCP_ADMINISTRATIVELY_PROHIBITED = 2245; // 0x8c5
    field public static final int VSNCP_APN_UNATHORIZED = 2238; // 0x8be
    field public static final int VSNCP_GEN_ERROR = 2237; // 0x8bd
    field public static final int VSNCP_INSUFFICIENT_PARAMETERS = 2243; // 0x8c3
    field public static final int VSNCP_NO_PDN_GATEWAY_ADDRESS = 2240; // 0x8c0
    field public static final int VSNCP_PDN_EXISTS_FOR_THIS_APN = 2248; // 0x8c8
    field public static final int VSNCP_PDN_GATEWAY_REJECT = 2242; // 0x8c2
    field public static final int VSNCP_PDN_GATEWAY_UNREACHABLE = 2241; // 0x8c1
    field public static final int VSNCP_PDN_ID_IN_USE = 2246; // 0x8c6
    field public static final int VSNCP_PDN_LIMIT_EXCEEDED = 2239; // 0x8bf
    field public static final int VSNCP_RECONNECT_NOT_ALLOWED = 2249; // 0x8c9
    field public static final int VSNCP_RESOURCE_UNAVAILABLE = 2244; // 0x8c4
    field public static final int VSNCP_SUBSCRIBER_LIMITATION = 2247; // 0x8c7
    field public static final int VSNCP_TIMEOUT = 2236; // 0x8bc
  }

  public final class DataSpecificRegistrationStates implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.telephony.LteVopsSupportInfo getLteVopsSupportInfo();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.DataSpecificRegistrationStates> CREATOR;
  }

  public final class DisconnectCause {
    field public static final int ALREADY_DIALING = 72; // 0x48
    field public static final int ANSWERED_ELSEWHERE = 52; // 0x34
    field public static final int BUSY = 4; // 0x4
    field public static final int CALLING_DISABLED = 74; // 0x4a
    field public static final int CALL_BARRED = 20; // 0x14
    field public static final int CALL_PULLED = 51; // 0x33
    field public static final int CANT_CALL_WHILE_RINGING = 73; // 0x49
    field public static final int CDMA_ACCESS_BLOCKED = 35; // 0x23
    field public static final int CDMA_ACCESS_FAILURE = 32; // 0x20
    field public static final int CDMA_ALREADY_ACTIVATED = 49; // 0x31
    field public static final int CDMA_DROP = 27; // 0x1b
    field public static final int CDMA_INTERCEPT = 28; // 0x1c
    field public static final int CDMA_LOCKED_UNTIL_POWER_CYCLE = 26; // 0x1a
    field public static final int CDMA_NOT_EMERGENCY = 34; // 0x22
    field public static final int CDMA_PREEMPTED = 33; // 0x21
    field public static final int CDMA_REORDER = 29; // 0x1d
    field public static final int CDMA_RETRY_ORDER = 31; // 0x1f
    field public static final int CDMA_SO_REJECT = 30; // 0x1e
    field public static final int CONGESTION = 5; // 0x5
    field public static final int CS_RESTRICTED = 22; // 0x16
    field public static final int CS_RESTRICTED_EMERGENCY = 24; // 0x18
    field public static final int CS_RESTRICTED_NORMAL = 23; // 0x17
    field public static final int DATA_DISABLED = 54; // 0x36
    field public static final int DATA_LIMIT_REACHED = 55; // 0x37
    field public static final int DIALED_CALL_FORWARDING_WHILE_ROAMING = 57; // 0x39
    field public static final int DIALED_MMI = 39; // 0x27
    field public static final int DIAL_LOW_BATTERY = 62; // 0x3e
    field public static final int DIAL_MODIFIED_TO_DIAL = 48; // 0x30
    field public static final int DIAL_MODIFIED_TO_DIAL_VIDEO = 66; // 0x42
    field public static final int DIAL_MODIFIED_TO_SS = 47; // 0x2f
    field public static final int DIAL_MODIFIED_TO_USSD = 46; // 0x2e
    field public static final int DIAL_VIDEO_MODIFIED_TO_DIAL = 69; // 0x45
    field public static final int DIAL_VIDEO_MODIFIED_TO_DIAL_VIDEO = 70; // 0x46
    field public static final int DIAL_VIDEO_MODIFIED_TO_SS = 67; // 0x43
    field public static final int DIAL_VIDEO_MODIFIED_TO_USSD = 68; // 0x44
    field public static final int EMERGENCY_PERM_FAILURE = 64; // 0x40
    field public static final int EMERGENCY_TEMP_FAILURE = 63; // 0x3f
    field public static final int ERROR_UNSPECIFIED = 36; // 0x24
    field public static final int FDN_BLOCKED = 21; // 0x15
    field public static final int ICC_ERROR = 19; // 0x13
    field public static final int IMEI_NOT_ACCEPTED = 58; // 0x3a
    field public static final int IMS_ACCESS_BLOCKED = 60; // 0x3c
    field public static final int IMS_MERGED_SUCCESSFULLY = 45; // 0x2d
    field public static final int IMS_SIP_ALTERNATE_EMERGENCY_CALL = 71; // 0x47
    field public static final int INCOMING_MISSED = 1; // 0x1
    field public static final int INCOMING_REJECTED = 16; // 0x10
    field public static final int INVALID_CREDENTIALS = 10; // 0xa
    field public static final int INVALID_NUMBER = 7; // 0x7
    field public static final int LIMIT_EXCEEDED = 15; // 0xf
    field public static final int LOCAL = 3; // 0x3
    field public static final int LOST_SIGNAL = 14; // 0xe
    field public static final int LOW_BATTERY = 61; // 0x3d
    field public static final int MAXIMUM_NUMBER_OF_CALLS_REACHED = 53; // 0x35
    field public static final int MMI = 6; // 0x6
    field public static final int NORMAL = 2; // 0x2
    field public static final int NORMAL_UNSPECIFIED = 65; // 0x41
    field public static final int NOT_DISCONNECTED = 0; // 0x0
    field public static final int NOT_VALID = -1; // 0xffffffff
    field public static final int NO_PHONE_NUMBER_SUPPLIED = 38; // 0x26
    field public static final int NUMBER_UNREACHABLE = 8; // 0x8
    field public static final int OTASP_PROVISIONING_IN_PROCESS = 76; // 0x4c
    field public static final int OUTGOING_CANCELED = 44; // 0x2c
    field public static final int OUTGOING_FAILURE = 43; // 0x2b
    field public static final int OUT_OF_NETWORK = 11; // 0xb
    field public static final int OUT_OF_SERVICE = 18; // 0x12
    field public static final int POWER_OFF = 17; // 0x11
    field public static final int SERVER_ERROR = 12; // 0xc
    field public static final int SERVER_UNREACHABLE = 9; // 0x9
    field public static final int TIMED_OUT = 13; // 0xd
    field public static final int TOO_MANY_ONGOING_CALLS = 75; // 0x4b
    field public static final int UNOBTAINABLE_NUMBER = 25; // 0x19
    field public static final int VIDEO_CALL_NOT_ALLOWED_WHILE_TTY_ENABLED = 50; // 0x32
    field public static final int VOICEMAIL_NUMBER_MISSING = 40; // 0x28
    field public static final int WIFI_LOST = 59; // 0x3b
  }

  public final class LteVopsSupportInfo implements android.os.Parcelable {
    ctor public LteVopsSupportInfo(int, int);
    method public int describeContents();
    method public int getEmcBearerSupport();
    method public int getVopsSupport();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.LteVopsSupportInfo> CREATOR;
    field public static final int LTE_STATUS_NOT_AVAILABLE = 1; // 0x1
    field public static final int LTE_STATUS_NOT_SUPPORTED = 3; // 0x3
    field public static final int LTE_STATUS_SUPPORTED = 2; // 0x2
  }

  public class MbmsDownloadSession implements java.lang.AutoCloseable {
    field public static final String MBMS_DOWNLOAD_SERVICE_ACTION = "android.telephony.action.EmbmsDownload";
  }

  public class MbmsGroupCallSession implements java.lang.AutoCloseable {
    field public static final String MBMS_GROUP_CALL_SERVICE_ACTION = "android.telephony.action.EmbmsGroupCall";
  }

  public class MbmsStreamingSession implements java.lang.AutoCloseable {
    field public static final String MBMS_STREAMING_SERVICE_ACTION = "android.telephony.action.EmbmsStreaming";
  }

  public class NetworkRegistrationState implements android.os.Parcelable {
    ctor public NetworkRegistrationState(int, int, int, int, int, boolean, @NonNull int[], @Nullable android.telephony.CellIdentity);
    method public int describeContents();
    method public int getAccessNetworkTechnology();
    method @NonNull public int[] getAvailableServices();
    method @Nullable public android.telephony.CellIdentity getCellIdentity();
    method @Nullable public android.telephony.DataSpecificRegistrationStates getDataSpecificStates();
    method public int getDomain();
    method public int getRegState();
    method public int getRejectCause();
    method public int getRoamingType();
    method public int getTransportType();
    method public boolean isEmergencyEnabled();
    method public boolean isRoaming();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.NetworkRegistrationState> CREATOR;
    field public static final int DOMAIN_CS = 1; // 0x1
    field public static final int DOMAIN_PS = 2; // 0x2
    field public static final int REG_STATE_DENIED = 3; // 0x3
    field public static final int REG_STATE_HOME = 1; // 0x1
    field public static final int REG_STATE_NOT_REG_NOT_SEARCHING = 0; // 0x0
    field public static final int REG_STATE_NOT_REG_SEARCHING = 2; // 0x2
    field public static final int REG_STATE_ROAMING = 5; // 0x5
    field public static final int REG_STATE_UNKNOWN = 4; // 0x4
    field public static final int SERVICE_TYPE_DATA = 2; // 0x2
    field public static final int SERVICE_TYPE_EMERGENCY = 5; // 0x5
    field public static final int SERVICE_TYPE_SMS = 3; // 0x3
    field public static final int SERVICE_TYPE_VIDEO = 4; // 0x4
    field public static final int SERVICE_TYPE_VOICE = 1; // 0x1
  }

  public static class NetworkRegistrationState.Builder {
    ctor public NetworkRegistrationState.Builder();
    method @NonNull public android.telephony.NetworkRegistrationState build();
    method @NonNull public android.telephony.NetworkRegistrationState.Builder setAccessNetworkTechnology(int);
    method @NonNull public android.telephony.NetworkRegistrationState.Builder setAvailableServices(@NonNull int[]);
    method @NonNull public android.telephony.NetworkRegistrationState.Builder setCellIdentity(@Nullable android.telephony.CellIdentity);
    method @NonNull public android.telephony.NetworkRegistrationState.Builder setDomain(int);
    method @NonNull public android.telephony.NetworkRegistrationState.Builder setEmergencyOnly(boolean);
    method @NonNull public android.telephony.NetworkRegistrationState.Builder setNrStatus(int);
    method @NonNull public android.telephony.NetworkRegistrationState.Builder setRegState(int);
    method @NonNull public android.telephony.NetworkRegistrationState.Builder setRejectCause(int);
    method @NonNull public android.telephony.NetworkRegistrationState.Builder setRoamingType(int);
    method @NonNull public android.telephony.NetworkRegistrationState.Builder setTransportType(int);
  }

  public abstract class NetworkService extends android.app.Service {
    ctor public NetworkService();
    method public android.os.IBinder onBind(android.content.Intent);
    method @Nullable public abstract android.telephony.NetworkService.NetworkServiceProvider onCreateNetworkServiceProvider(int);
    field public static final String NETWORK_SERVICE_INTERFACE = "android.telephony.NetworkService";
  }

  public abstract class NetworkService.NetworkServiceProvider implements java.lang.AutoCloseable {
    ctor public NetworkService.NetworkServiceProvider(int);
    method public abstract void close();
    method public void getNetworkRegistrationState(int, @NonNull android.telephony.NetworkServiceCallback);
    method public final int getSlotIndex();
    method public final void notifyNetworkRegistrationStateChanged();
  }

  public class NetworkServiceCallback {
    method public void onGetNetworkRegistrationStateComplete(int, @Nullable android.telephony.NetworkRegistrationState);
    field public static final int RESULT_ERROR_BUSY = 3; // 0x3
    field public static final int RESULT_ERROR_FAILED = 5; // 0x5
    field public static final int RESULT_ERROR_ILLEGAL_STATE = 4; // 0x4
    field public static final int RESULT_ERROR_INVALID_ARG = 2; // 0x2
    field public static final int RESULT_ERROR_UNSUPPORTED = 1; // 0x1
    field public static final int RESULT_SUCCESS = 0; // 0x0
  }

  public interface NumberVerificationCallback {
    method public default void onCallReceived(@NonNull String);
    method public default void onVerificationFailed(int);
    field public static final int REASON_CONCURRENT_REQUESTS = 4; // 0x4
    field public static final int REASON_IN_ECBM = 5; // 0x5
    field public static final int REASON_IN_EMERGENCY_CALL = 6; // 0x6
    field public static final int REASON_NETWORK_NOT_AVAILABLE = 2; // 0x2
    field public static final int REASON_TIMED_OUT = 1; // 0x1
    field public static final int REASON_TOO_MANY_CALLS = 3; // 0x3
    field public static final int REASON_UNSPECIFIED = 0; // 0x0
  }

  public final class PhoneNumberRange implements android.os.Parcelable {
    ctor public PhoneNumberRange(@NonNull String, @NonNull String, @NonNull String, @NonNull String);
    method public int describeContents();
    method public boolean matches(@NonNull String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.PhoneNumberRange> CREATOR;
  }

  public class PhoneStateListener {
    method public void onCallAttributesChanged(@NonNull android.telephony.CallAttributes);
    method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onCallDisconnectCauseChanged(int, int);
    method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onImsCallDisconnectCauseChanged(@NonNull android.telephony.ims.ImsReasonInfo);
    method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onPreciseCallStateChanged(@NonNull android.telephony.PreciseCallState);
    method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onPreciseDataConnectionStateChanged(@NonNull android.telephony.PreciseDataConnectionState);
    method public void onRadioPowerStateChanged(int);
    method public void onSrvccStateChanged(int);
    method public void onVoiceActivationStateChanged(int);
    field public static final int LISTEN_CALL_ATTRIBUTES_CHANGED = 67108864; // 0x4000000
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_CALL_DISCONNECT_CAUSES = 33554432; // 0x2000000
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_IMS_CALL_DISCONNECT_CAUSES = 134217728; // 0x8000000
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_PRECISE_CALL_STATE = 2048; // 0x800
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_PRECISE_DATA_CONNECTION_STATE = 4096; // 0x1000
    field public static final int LISTEN_RADIO_POWER_STATE_CHANGED = 8388608; // 0x800000
    field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_SRVCC_STATE_CHANGED = 16384; // 0x4000
    field public static final int LISTEN_VOICE_ACTIVATION_STATE = 131072; // 0x20000
  }

  public final class PreciseCallState implements android.os.Parcelable {
    method public int describeContents();
    method public int getBackgroundCallState();
    method public int getForegroundCallState();
    method public int getRingingCallState();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.PreciseCallState> CREATOR;
    field public static final int PRECISE_CALL_STATE_ACTIVE = 1; // 0x1
    field public static final int PRECISE_CALL_STATE_ALERTING = 4; // 0x4
    field public static final int PRECISE_CALL_STATE_DIALING = 3; // 0x3
    field public static final int PRECISE_CALL_STATE_DISCONNECTED = 7; // 0x7
    field public static final int PRECISE_CALL_STATE_DISCONNECTING = 8; // 0x8
    field public static final int PRECISE_CALL_STATE_HOLDING = 2; // 0x2
    field public static final int PRECISE_CALL_STATE_IDLE = 0; // 0x0
    field public static final int PRECISE_CALL_STATE_INCOMING = 5; // 0x5
    field public static final int PRECISE_CALL_STATE_NOT_VALID = -1; // 0xffffffff
    field public static final int PRECISE_CALL_STATE_WAITING = 6; // 0x6
  }

  public final class PreciseDataConnectionState implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getDataConnectionApn();
    method public int getDataConnectionApnTypeBitMask();
    method public int getDataConnectionFailCause();
    method public int getDataConnectionState();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.PreciseDataConnectionState> CREATOR;
  }

  public final class PreciseDisconnectCause {
    field public static final int ACCESS_CLASS_BLOCKED = 260; // 0x104
    field public static final int ACCESS_INFORMATION_DISCARDED = 43; // 0x2b
    field public static final int ACM_LIMIT_EXCEEDED = 68; // 0x44
    field public static final int BEARER_CAPABILITY_NOT_AUTHORIZED = 57; // 0x39
    field public static final int BEARER_NOT_AVAIL = 58; // 0x3a
    field public static final int BEARER_SERVICE_NOT_IMPLEMENTED = 65; // 0x41
    field public static final int BUSY = 17; // 0x11
    field public static final int CALL_BARRED = 240; // 0xf0
    field public static final int CALL_REJECTED = 21; // 0x15
    field public static final int CDMA_ACCESS_BLOCKED = 1009; // 0x3f1
    field public static final int CDMA_ACCESS_FAILURE = 1006; // 0x3ee
    field public static final int CDMA_DROP = 1001; // 0x3e9
    field public static final int CDMA_INTERCEPT = 1002; // 0x3ea
    field public static final int CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000; // 0x3e8
    field public static final int CDMA_NOT_EMERGENCY = 1008; // 0x3f0
    field public static final int CDMA_PREEMPTED = 1007; // 0x3ef
    field public static final int CDMA_REORDER = 1003; // 0x3eb
    field public static final int CDMA_RETRY_ORDER = 1005; // 0x3ed
    field public static final int CDMA_SO_REJECT = 1004; // 0x3ec
    field public static final int CHANNEL_NOT_AVAIL = 44; // 0x2c
    field public static final int CHANNEL_UNACCEPTABLE = 6; // 0x6
    field public static final int CONDITIONAL_IE_ERROR = 100; // 0x64
    field public static final int DESTINATION_OUT_OF_ORDER = 27; // 0x1b
    field public static final int ERROR_UNSPECIFIED = 65535; // 0xffff
    field public static final int FACILITY_REJECTED = 29; // 0x1d
    field public static final int FDN_BLOCKED = 241; // 0xf1
    field public static final int IMEI_NOT_ACCEPTED = 243; // 0xf3
    field public static final int IMSI_UNKNOWN_IN_VLR = 242; // 0xf2
    field public static final int INCOMING_CALLS_BARRED_WITHIN_CUG = 55; // 0x37
    field public static final int INCOMPATIBLE_DESTINATION = 88; // 0x58
    field public static final int INFORMATION_ELEMENT_NON_EXISTENT = 99; // 0x63
    field public static final int INTERWORKING_UNSPECIFIED = 127; // 0x7f
    field public static final int INVALID_MANDATORY_INFORMATION = 96; // 0x60
    field public static final int INVALID_NUMBER_FORMAT = 28; // 0x1c
    field public static final int INVALID_TRANSACTION_IDENTIFIER = 81; // 0x51
    field public static final int MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101; // 0x65
    field public static final int MESSAGE_TYPE_NON_IMPLEMENTED = 97; // 0x61
    field public static final int MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98; // 0x62
    field public static final int NETWORK_DETACH = 261; // 0x105
    field public static final int NETWORK_OUT_OF_ORDER = 38; // 0x26
    field public static final int NETWORK_REJECT = 252; // 0xfc
    field public static final int NETWORK_RESP_TIMEOUT = 251; // 0xfb
    field public static final int NORMAL = 16; // 0x10
    field public static final int NORMAL_UNSPECIFIED = 31; // 0x1f
    field public static final int NOT_VALID = -1; // 0xffffffff
    field public static final int NO_ANSWER_FROM_USER = 19; // 0x13
    field public static final int NO_CIRCUIT_AVAIL = 34; // 0x22
    field public static final int NO_DISCONNECT_CAUSE_AVAILABLE = 0; // 0x0
    field public static final int NO_ROUTE_TO_DESTINATION = 3; // 0x3
    field public static final int NO_USER_RESPONDING = 18; // 0x12
    field public static final int NO_VALID_SIM = 249; // 0xf9
    field public static final int NUMBER_CHANGED = 22; // 0x16
    field public static final int OEM_CAUSE_1 = 61441; // 0xf001
    field public static final int OEM_CAUSE_10 = 61450; // 0xf00a
    field public static final int OEM_CAUSE_11 = 61451; // 0xf00b
    field public static final int OEM_CAUSE_12 = 61452; // 0xf00c
    field public static final int OEM_CAUSE_13 = 61453; // 0xf00d
    field public static final int OEM_CAUSE_14 = 61454; // 0xf00e
    field public static final int OEM_CAUSE_15 = 61455; // 0xf00f
    field public static final int OEM_CAUSE_2 = 61442; // 0xf002
    field public static final int OEM_CAUSE_3 = 61443; // 0xf003
    field public static final int OEM_CAUSE_4 = 61444; // 0xf004
    field public static final int OEM_CAUSE_5 = 61445; // 0xf005
    field public static final int OEM_CAUSE_6 = 61446; // 0xf006
    field public static final int OEM_CAUSE_7 = 61447; // 0xf007
    field public static final int OEM_CAUSE_8 = 61448; // 0xf008
    field public static final int OEM_CAUSE_9 = 61449; // 0xf009
    field public static final int ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70; // 0x46
    field public static final int OPERATOR_DETERMINED_BARRING = 8; // 0x8
    field public static final int OUT_OF_SRV = 248; // 0xf8
    field public static final int PREEMPTION = 25; // 0x19
    field public static final int PROTOCOL_ERROR_UNSPECIFIED = 111; // 0x6f
    field public static final int QOS_NOT_AVAIL = 49; // 0x31
    field public static final int RADIO_ACCESS_FAILURE = 253; // 0xfd
    field public static final int RADIO_INTERNAL_ERROR = 250; // 0xfa
    field public static final int RADIO_LINK_FAILURE = 254; // 0xfe
    field public static final int RADIO_LINK_LOST = 255; // 0xff
    field public static final int RADIO_OFF = 247; // 0xf7
    field public static final int RADIO_RELEASE_ABNORMAL = 259; // 0x103
    field public static final int RADIO_RELEASE_NORMAL = 258; // 0x102
    field public static final int RADIO_SETUP_FAILURE = 257; // 0x101
    field public static final int RADIO_UPLINK_FAILURE = 256; // 0x100
    field public static final int RECOVERY_ON_TIMER_EXPIRED = 102; // 0x66
    field public static final int REQUESTED_FACILITY_NOT_IMPLEMENTED = 69; // 0x45
    field public static final int REQUESTED_FACILITY_NOT_SUBSCRIBED = 50; // 0x32
    field public static final int RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47; // 0x2f
    field public static final int SEMANTICALLY_INCORRECT_MESSAGE = 95; // 0x5f
    field public static final int SERVICE_OPTION_NOT_AVAILABLE = 63; // 0x3f
    field public static final int SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79; // 0x4f
    field public static final int STATUS_ENQUIRY = 30; // 0x1e
    field public static final int SWITCHING_CONGESTION = 42; // 0x2a
    field public static final int TEMPORARY_FAILURE = 41; // 0x29
    field public static final int UNOBTAINABLE_NUMBER = 1; // 0x1
    field public static final int USER_NOT_MEMBER_OF_CUG = 87; // 0x57
  }

  public class ServiceState implements android.os.Parcelable {
    method @Nullable public android.telephony.NetworkRegistrationState getNetworkRegistrationState(int, int);
    method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates();
    method @Deprecated @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStates(int);
    method @Deprecated @Nullable public android.telephony.NetworkRegistrationState getNetworkRegistrationStates(int, int);
    method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForDomain(int);
    method @NonNull public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(int);
    field public static final int ROAMING_TYPE_DOMESTIC = 2; // 0x2
    field public static final int ROAMING_TYPE_INTERNATIONAL = 3; // 0x3
    field public static final int ROAMING_TYPE_NOT_ROAMING = 0; // 0x0
    field public static final int ROAMING_TYPE_UNKNOWN = 1; // 0x1
  }

  public final class SmsManager {
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void sendMultipartTextMessageWithoutPersisting(String, String, java.util.List<java.lang.String>, java.util.List<android.app.PendingIntent>, java.util.List<android.app.PendingIntent>);
    field public static final int RESULT_CANCELLED = 23; // 0x17
    field public static final int RESULT_ENCODING_ERROR = 18; // 0x12
    field public static final int RESULT_ERROR_FDN_CHECK_FAILURE = 6; // 0x6
    field public static final int RESULT_ERROR_NONE = 0; // 0x0
    field public static final int RESULT_INTERNAL_ERROR = 21; // 0x15
    field public static final int RESULT_INVALID_ARGUMENTS = 11; // 0xb
    field public static final int RESULT_INVALID_SMSC_ADDRESS = 19; // 0x13
    field public static final int RESULT_INVALID_SMS_FORMAT = 14; // 0xe
    field public static final int RESULT_INVALID_STATE = 12; // 0xc
    field public static final int RESULT_MODEM_ERROR = 16; // 0x10
    field public static final int RESULT_NETWORK_ERROR = 17; // 0x11
    field public static final int RESULT_NETWORK_REJECT = 10; // 0xa
    field public static final int RESULT_NO_MEMORY = 13; // 0xd
    field public static final int RESULT_NO_RESOURCES = 22; // 0x16
    field public static final int RESULT_OPERATION_NOT_ALLOWED = 20; // 0x14
    field public static final int RESULT_RADIO_NOT_AVAILABLE = 9; // 0x9
    field public static final int RESULT_REQUEST_NOT_SUPPORTED = 24; // 0x18
    field public static final int RESULT_SYSTEM_ERROR = 15; // 0xf
  }

  public class SubscriptionInfo implements android.os.Parcelable {
    method @Nullable public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
    method public int getProfileClass();
  }

  public class SubscriptionManager {
    method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isSubscriptionEnabled(int);
    method public void requestEmbeddedSubscriptionInfoListRefresh();
    method public void requestEmbeddedSubscriptionInfoListRefresh(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultDataSubId(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultSmsSubId(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean);
    field @NonNull public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI;
    field public static final int PROFILE_CLASS_DEFAULT = -1; // 0xffffffff
    field public static final int PROFILE_CLASS_OPERATIONAL = 2; // 0x2
    field public static final int PROFILE_CLASS_PROVISIONING = 1; // 0x1
    field public static final int PROFILE_CLASS_TESTING = 0; // 0x0
    field public static final int PROFILE_CLASS_UNSET = -1; // 0xffffffff
    field @NonNull public static final android.net.Uri VT_ENABLED_CONTENT_URI;
    field @NonNull public static final android.net.Uri WFC_ENABLED_CONTENT_URI;
    field @NonNull public static final android.net.Uri WFC_MODE_CONTENT_URI;
    field @NonNull public static final android.net.Uri WFC_ROAMING_ENABLED_CONTENT_URI;
    field @NonNull public static final android.net.Uri WFC_ROAMING_MODE_CONTENT_URI;
  }

  public static class SubscriptionPlan.Builder {
    method @Deprecated public static android.telephony.SubscriptionPlan.Builder createRecurringDaily(java.time.ZonedDateTime);
    method @Deprecated public static android.telephony.SubscriptionPlan.Builder createRecurringMonthly(java.time.ZonedDateTime);
    method @Deprecated public static android.telephony.SubscriptionPlan.Builder createRecurringWeekly(java.time.ZonedDateTime);
  }

  public final class TelephonyHistogram implements android.os.Parcelable {
    ctor public TelephonyHistogram(int, int, int);
    ctor public TelephonyHistogram(android.telephony.TelephonyHistogram);
    ctor public TelephonyHistogram(android.os.Parcel);
    method public void addTimeTaken(int);
    method public int describeContents();
    method public int getAverageTime();
    method public int getBucketCount();
    method public int[] getBucketCounters();
    method public int[] getBucketEndPoints();
    method public int getCategory();
    method public int getId();
    method public int getMaxTime();
    method public int getMinTime();
    method public int getSampleCount();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.TelephonyHistogram> CREATOR;
    field public static final int TELEPHONY_CATEGORY_RIL = 1; // 0x1
  }

  public class TelephonyManager {
    method @Deprecated @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void call(String, String);
    method public int checkCarrierPrivilegesForPackage(String);
    method public int checkCarrierPrivilegesForPackageAnyPhone(String);
    method public void dial(String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean disableDataConnectivity();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableDataConnectivity();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableModemForSlot(int, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void enableVideoCalling(boolean);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getAidForAppType(int);
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
    method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.CarrierRestrictionRules getCarrierRestrictionRules();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMdn();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMdn(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMin();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMin(int);
    method public String getCdmaPrlVersion();
    method public int getCurrentPhoneType();
    method public int getCurrentPhoneType(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getDataActivationState();
    method @Deprecated public boolean getDataEnabled();
    method @Deprecated public boolean getDataEnabled(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.util.Pair<java.lang.Integer,java.lang.Integer>> getLogicalToPhysicalSlotMapping();
    method public static long getMaxNumberVerificationTimeoutMillis();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmap();
    method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
    method public int getSimApplicationState();
    method public int getSimCardState();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Locale getSimLocale();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getSupportedRadioAccessFamily();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public java.util.List<android.telephony.TelephonyHistogram> getTelephonyHistograms();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.UiccSlotInfo[] getUiccSlotsInfo();
    method @Nullable public android.os.Bundle getVisualVoicemailSettings();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoiceActivationState();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handlePinMmi(String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean handlePinMmiForSubscriber(int, String);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isCurrentPotentialEmergencyNumber(@NonNull String);
    method public boolean isDataConnectivityPossible();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isIdle();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isRebootRequiredForModemConfigChange();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging();
    method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isVideoCallingEnabled();
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isVisualVoicemailEnabled(android.telecom.PhoneAccountHandle);
    method public boolean needsOtaServiceProvisioning();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean rebootRadio();
    method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.MODIFY_PHONE_STATE}) public void requestCellInfoUpdate(@NonNull android.os.WorkSource, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CellInfoCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void requestNumberVerification(@NonNull android.telephony.PhoneNumberRange, long, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.NumberVerificationCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean resetRadioConfig();
    method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCarrierDataEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
    method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultisimCarrierRestriction(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setPreferredNetworkTypeBitmap(long);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadio(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadioPower(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerState(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerStateForSlot(int, int);
    method @Deprecated public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoiceActivationState(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPin(String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPuk(String, String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean switchSlots(int[]);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void toggleRadioOnOff();
    method public void updateServiceLocation();
    field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final String ACTION_DEBUG_EVENT = "android.telephony.action.DEBUG_EVENT";
    field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
    field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
    field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
    field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
    field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
    field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
    field public static final int CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED = -1; // 0xffffffff
    field public static final String EXTRA_DEBUG_EVENT_DESCRIPTION = "android.telephony.extra.DEBUG_EVENT_DESCRIPTION";
    field public static final String EXTRA_DEBUG_EVENT_ID = "android.telephony.extra.DEBUG_EVENT_ID";
    field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
    field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
    field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
    field public static final long NETWORK_TYPE_BITMASK_1xRTT = 64L; // 0x40L
    field public static final long NETWORK_TYPE_BITMASK_CDMA = 8L; // 0x8L
    field public static final long NETWORK_TYPE_BITMASK_EDGE = 2L; // 0x2L
    field public static final long NETWORK_TYPE_BITMASK_EHRPD = 8192L; // 0x2000L
    field public static final long NETWORK_TYPE_BITMASK_EVDO_0 = 16L; // 0x10L
    field public static final long NETWORK_TYPE_BITMASK_EVDO_A = 32L; // 0x20L
    field public static final long NETWORK_TYPE_BITMASK_EVDO_B = 2048L; // 0x800L
    field public static final long NETWORK_TYPE_BITMASK_GPRS = 1L; // 0x1L
    field public static final long NETWORK_TYPE_BITMASK_GSM = 32768L; // 0x8000L
    field public static final long NETWORK_TYPE_BITMASK_HSDPA = 128L; // 0x80L
    field public static final long NETWORK_TYPE_BITMASK_HSPA = 512L; // 0x200L
    field public static final long NETWORK_TYPE_BITMASK_HSPAP = 16384L; // 0x4000L
    field public static final long NETWORK_TYPE_BITMASK_HSUPA = 256L; // 0x100L
    field public static final long NETWORK_TYPE_BITMASK_IWLAN = 131072L; // 0x20000L
    field public static final long NETWORK_TYPE_BITMASK_LTE = 4096L; // 0x1000L
    field public static final long NETWORK_TYPE_BITMASK_LTE_CA = 262144L; // 0x40000L
    field public static final long NETWORK_TYPE_BITMASK_NR = 524288L; // 0x80000L
    field public static final long NETWORK_TYPE_BITMASK_TD_SCDMA = 65536L; // 0x10000L
    field public static final long NETWORK_TYPE_BITMASK_UMTS = 4L; // 0x4L
    field public static final long NETWORK_TYPE_BITMASK_UNKNOWN = 0L; // 0x0L
    field public static final int RADIO_POWER_OFF = 0; // 0x0
    field public static final int RADIO_POWER_ON = 1; // 0x1
    field public static final int RADIO_POWER_UNAVAILABLE = 2; // 0x2
    field public static final int SET_CARRIER_RESTRICTION_ERROR = 2; // 0x2
    field public static final int SET_CARRIER_RESTRICTION_NOT_SUPPORTED = 1; // 0x1
    field public static final int SET_CARRIER_RESTRICTION_SUCCESS = 0; // 0x0
    field public static final int SIM_ACTIVATION_STATE_ACTIVATED = 2; // 0x2
    field public static final int SIM_ACTIVATION_STATE_ACTIVATING = 1; // 0x1
    field public static final int SIM_ACTIVATION_STATE_DEACTIVATED = 3; // 0x3
    field public static final int SIM_ACTIVATION_STATE_RESTRICTED = 4; // 0x4
    field public static final int SIM_ACTIVATION_STATE_UNKNOWN = 0; // 0x0
    field public static final int SIM_STATE_LOADED = 10; // 0xa
    field public static final int SIM_STATE_PRESENT = 11; // 0xb
    field public static final int SRVCC_STATE_HANDOVER_CANCELED = 3; // 0x3
    field public static final int SRVCC_STATE_HANDOVER_COMPLETED = 1; // 0x1
    field public static final int SRVCC_STATE_HANDOVER_FAILED = 2; // 0x2
    field public static final int SRVCC_STATE_HANDOVER_NONE = -1; // 0xffffffff
    field public static final int SRVCC_STATE_HANDOVER_STARTED = 0; // 0x0
  }

  public final class UiccAccessRule implements android.os.Parcelable {
    ctor public UiccAccessRule(byte[], @Nullable String, long);
    method public int describeContents();
    method public int getCarrierPrivilegeStatus(android.content.pm.PackageInfo);
    method public int getCarrierPrivilegeStatus(android.content.pm.Signature, String);
    method public String getCertificateHexString();
    method @Nullable public String getPackageName();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.UiccAccessRule> CREATOR;
  }

  public class UiccSlotInfo implements android.os.Parcelable {
    ctor @Deprecated public UiccSlotInfo(boolean, boolean, String, int, int, boolean);
    method public int describeContents();
    method public String getCardId();
    method public int getCardStateInfo();
    method public boolean getIsActive();
    method public boolean getIsEuicc();
    method public boolean getIsExtendedApduSupported();
    method public int getLogicalSlotIdx();
    method public boolean isRemovable();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CARD_STATE_INFO_ABSENT = 1; // 0x1
    field public static final int CARD_STATE_INFO_ERROR = 3; // 0x3
    field public static final int CARD_STATE_INFO_PRESENT = 2; // 0x2
    field public static final int CARD_STATE_INFO_RESTRICTED = 4; // 0x4
    field public static final android.os.Parcelable.Creator<android.telephony.UiccSlotInfo> CREATOR;
  }

  public abstract class VisualVoicemailService extends android.app.Service {
    method public static final void sendVisualVoicemailSms(android.content.Context, android.telecom.PhoneAccountHandle, String, short, String, android.app.PendingIntent);
    method public static final void setSmsFilterSettings(android.content.Context, android.telecom.PhoneAccountHandle, android.telephony.VisualVoicemailSmsFilterSettings);
  }

}

package android.telephony.data {

  public final class DataCallResponse implements android.os.Parcelable {
    ctor public DataCallResponse(int, int, int, int, int, @Nullable String, @Nullable java.util.List<android.net.LinkAddress>, @Nullable java.util.List<java.net.InetAddress>, @Nullable java.util.List<java.net.InetAddress>, @Nullable java.util.List<java.lang.String>, int);
    method public int describeContents();
    method public int getActive();
    method @NonNull public java.util.List<android.net.LinkAddress> getAddresses();
    method public int getCallId();
    method @NonNull public java.util.List<java.net.InetAddress> getDnses();
    method @NonNull public java.util.List<java.net.InetAddress> getGateways();
    method @NonNull public String getIfname();
    method public int getMtu();
    method @NonNull public java.util.List<java.lang.String> getPcscfs();
    method public int getProtocolType();
    method public int getStatus();
    method public int getSuggestedRetryTime();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
  }

  public final class DataProfile implements android.os.Parcelable {
    method public String getApn();
    method public int getAuthType();
    method public int getBearerBitmap();
    method public int getMaxConns();
    method public int getMaxConnsTime();
    method public int getMtu();
    method public String getPassword();
    method public int getProfileId();
    method public int getProtocol();
    method public int getRoamingProtocol();
    method public int getSupportedApnTypesBitmap();
    method public int getType();
    method public String getUserName();
    method public int getWaitTime();
    method public boolean isEnabled();
    method public boolean isPersistent();
    method public boolean isPreferred();
    field public static final int TYPE_3GPP = 1; // 0x1
    field public static final int TYPE_3GPP2 = 2; // 0x2
    field public static final int TYPE_COMMON = 0; // 0x0
  }

  public abstract class DataService extends android.app.Service {
    ctor public DataService();
    method public android.os.IBinder onBind(android.content.Intent);
    method @Nullable public abstract android.telephony.data.DataService.DataServiceProvider onCreateDataServiceProvider(int);
    field public static final String DATA_SERVICE_INTERFACE = "android.telephony.data.DataService";
    field public static final int REQUEST_REASON_HANDOVER = 3; // 0x3
    field public static final int REQUEST_REASON_NORMAL = 1; // 0x1
    field public static final int REQUEST_REASON_SHUTDOWN = 2; // 0x2
  }

  public abstract class DataService.DataServiceProvider implements java.lang.AutoCloseable {
    ctor public DataService.DataServiceProvider(int);
    method public abstract void close();
    method public void deactivateDataCall(int, int, @Nullable android.telephony.data.DataServiceCallback);
    method public void getDataCallList(@NonNull android.telephony.data.DataServiceCallback);
    method public final int getSlotIndex();
    method public final void notifyDataCallListChanged(java.util.List<android.telephony.data.DataCallResponse>);
    method public void setDataProfile(@NonNull java.util.List<android.telephony.data.DataProfile>, boolean, @Nullable android.telephony.data.DataServiceCallback);
    method public void setInitialAttachApn(@NonNull android.telephony.data.DataProfile, boolean, @Nullable android.telephony.data.DataServiceCallback);
    method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @Nullable android.telephony.data.DataServiceCallback);
  }

  public class DataServiceCallback {
    method public void onDataCallListChanged(@NonNull java.util.List<android.telephony.data.DataCallResponse>);
    method public void onDeactivateDataCallComplete(int);
    method public void onGetDataCallListComplete(int, @NonNull java.util.List<android.telephony.data.DataCallResponse>);
    method public void onSetDataProfileComplete(int);
    method public void onSetInitialAttachApnComplete(int);
    method public void onSetupDataCallComplete(int, @Nullable android.telephony.data.DataCallResponse);
    field public static final int RESULT_ERROR_BUSY = 3; // 0x3
    field public static final int RESULT_ERROR_ILLEGAL_STATE = 4; // 0x4
    field public static final int RESULT_ERROR_INVALID_ARG = 2; // 0x2
    field public static final int RESULT_ERROR_UNSUPPORTED = 1; // 0x1
    field public static final int RESULT_SUCCESS = 0; // 0x0
  }

  public abstract class QualifiedNetworksService extends android.app.Service {
    ctor public QualifiedNetworksService();
    method @NonNull public abstract android.telephony.data.QualifiedNetworksService.NetworkAvailabilityUpdater createNetworkAvailabilityUpdater(int);
    field public static final String QUALIFIED_NETWORKS_SERVICE_INTERFACE = "android.telephony.data.QualifiedNetworksService";
  }

  public abstract class QualifiedNetworksService.NetworkAvailabilityUpdater implements java.lang.AutoCloseable {
    ctor public QualifiedNetworksService.NetworkAvailabilityUpdater(int);
    method public abstract void close();
    method public final int getSlotIndex();
    method public final void updateQualifiedNetworkTypes(int, @Nullable int[]);
  }

}

package android.telephony.euicc {

  public final class DownloadableSubscription implements android.os.Parcelable {
    method public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
    method @Nullable public String getCarrierName();
  }

  public static final class DownloadableSubscription.Builder {
    ctor public DownloadableSubscription.Builder();
    ctor public DownloadableSubscription.Builder(android.telephony.euicc.DownloadableSubscription);
    method public android.telephony.euicc.DownloadableSubscription build();
    method public android.telephony.euicc.DownloadableSubscription.Builder setAccessRules(java.util.List<android.telephony.UiccAccessRule>);
    method public android.telephony.euicc.DownloadableSubscription.Builder setCarrierName(String);
    method public android.telephony.euicc.DownloadableSubscription.Builder setConfirmationCode(String);
    method public android.telephony.euicc.DownloadableSubscription.Builder setEncodedActivationCode(String);
  }

  public class EuiccCardManager {
    method public void authenticateServer(String, String, byte[], byte[], byte[], byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
    method public void cancelSession(String, byte[], @android.telephony.euicc.EuiccCardManager.CancelReason int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
    method public void deleteProfile(String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
    method public void disableProfile(String, String, boolean, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
    method public void listNotifications(String, @android.telephony.euicc.EuiccNotification.Event int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification[]>);
    method public void loadBoundProfilePackage(String, byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
    method public void prepareDownload(String, @Nullable byte[], byte[], byte[], byte[], java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
    method public void removeNotificationFromList(String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
    method public void requestAllProfiles(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo[]>);
    method public void requestDefaultSmdpAddress(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.String>);
    method public void requestEuiccChallenge(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
    method public void requestEuiccInfo1(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
    method public void requestEuiccInfo2(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<byte[]>);
    method public void requestProfile(String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo>);
    method public void requestRulesAuthTable(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccRulesAuthTable>);
    method public void requestSmdsAddress(String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.String>);
    method public void resetMemory(String, @android.telephony.euicc.EuiccCardManager.ResetOption int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
    method public void retrieveNotification(String, int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification>);
    method public void retrieveNotificationList(String, @android.telephony.euicc.EuiccNotification.Event int, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.telephony.euicc.EuiccNotification[]>);
    method public void setDefaultSmdpAddress(String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
    method public void setNickname(String, String, String, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<java.lang.Void>);
    method public void switchToProfile(String, String, boolean, java.util.concurrent.Executor, android.telephony.euicc.EuiccCardManager.ResultCallback<android.service.euicc.EuiccProfileInfo>);
    field public static final int CANCEL_REASON_END_USER_REJECTED = 0; // 0x0
    field public static final int CANCEL_REASON_POSTPONED = 1; // 0x1
    field public static final int CANCEL_REASON_PPR_NOT_ALLOWED = 3; // 0x3
    field public static final int CANCEL_REASON_TIMEOUT = 2; // 0x2
    field public static final int RESET_OPTION_DELETE_FIELD_LOADED_TEST_PROFILES = 2; // 0x2
    field public static final int RESET_OPTION_DELETE_OPERATIONAL_PROFILES = 1; // 0x1
    field public static final int RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS = 4; // 0x4
    field public static final int RESULT_CALLER_NOT_ALLOWED = -3; // 0xfffffffd
    field public static final int RESULT_EUICC_NOT_FOUND = -2; // 0xfffffffe
    field public static final int RESULT_OK = 0; // 0x0
    field public static final int RESULT_UNKNOWN_ERROR = -1; // 0xffffffff
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef(prefix={"CANCEL_REASON_"}, value={android.telephony.euicc.EuiccCardManager.CANCEL_REASON_END_USER_REJECTED, android.telephony.euicc.EuiccCardManager.CANCEL_REASON_POSTPONED, android.telephony.euicc.EuiccCardManager.CANCEL_REASON_TIMEOUT, android.telephony.euicc.EuiccCardManager.CANCEL_REASON_PPR_NOT_ALLOWED}) public static @interface EuiccCardManager.CancelReason {
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef(flag=true, prefix={"RESET_OPTION_"}, value={android.telephony.euicc.EuiccCardManager.RESET_OPTION_DELETE_OPERATIONAL_PROFILES, android.telephony.euicc.EuiccCardManager.RESET_OPTION_DELETE_FIELD_LOADED_TEST_PROFILES, android.telephony.euicc.EuiccCardManager.RESET_OPTION_RESET_DEFAULT_SMDP_ADDRESS}) public static @interface EuiccCardManager.ResetOption {
  }

  public static interface EuiccCardManager.ResultCallback<T> {
    method public void onComplete(int, T);
  }

  public class EuiccManager {
    method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void continueOperation(android.content.Intent, android.os.Bundle);
    method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void eraseSubscriptions(android.app.PendingIntent);
    method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void getDefaultDownloadableSubscriptionList(android.app.PendingIntent);
    method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void getDownloadableSubscriptionMetadata(android.telephony.euicc.DownloadableSubscription, android.app.PendingIntent);
    method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public int getOtaStatus();
    field public static final String ACTION_DELETE_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.DELETE_SUBSCRIPTION_PRIVILEGED";
    field @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public static final String ACTION_OTA_STATUS_CHANGED = "android.telephony.euicc.action.OTA_STATUS_CHANGED";
    field public static final String ACTION_PROVISION_EMBEDDED_SUBSCRIPTION = "android.telephony.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION";
    field public static final String ACTION_RENAME_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.RENAME_SUBSCRIPTION_PRIVILEGED";
    field public static final String ACTION_TOGGLE_SUBSCRIPTION_PRIVILEGED = "android.telephony.euicc.action.TOGGLE_SUBSCRIPTION_PRIVILEGED";
    field public static final int EUICC_OTA_FAILED = 2; // 0x2
    field public static final int EUICC_OTA_IN_PROGRESS = 1; // 0x1
    field public static final int EUICC_OTA_NOT_NEEDED = 4; // 0x4
    field public static final int EUICC_OTA_STATUS_UNAVAILABLE = 5; // 0x5
    field public static final int EUICC_OTA_SUCCEEDED = 3; // 0x3
    field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTIONS";
    field public static final String EXTRA_ENABLE_SUBSCRIPTION = "android.telephony.euicc.extra.ENABLE_SUBSCRIPTION";
    field public static final String EXTRA_SUBSCRIPTION_ID = "android.telephony.euicc.extra.SUBSCRIPTION_ID";
    field public static final String EXTRA_SUBSCRIPTION_NICKNAME = "android.telephony.euicc.extra.SUBSCRIPTION_NICKNAME";
  }

  @IntDef(prefix={"EUICC_OTA_"}, value={android.telephony.euicc.EuiccManager.EUICC_OTA_IN_PROGRESS, android.telephony.euicc.EuiccManager.EUICC_OTA_FAILED, android.telephony.euicc.EuiccManager.EUICC_OTA_SUCCEEDED, android.telephony.euicc.EuiccManager.EUICC_OTA_NOT_NEEDED, android.telephony.euicc.EuiccManager.EUICC_OTA_STATUS_UNAVAILABLE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccManager.OtaStatus {
  }

  public final class EuiccNotification implements android.os.Parcelable {
    ctor public EuiccNotification(int, String, @android.telephony.euicc.EuiccNotification.Event int, @Nullable byte[]);
    method public int describeContents();
    method @Nullable public byte[] getData();
    method @android.telephony.euicc.EuiccNotification.Event public int getEvent();
    method public int getSeq();
    method public String getTargetAddr();
    method public void writeToParcel(android.os.Parcel, int);
    field @android.telephony.euicc.EuiccNotification.Event public static final int ALL_EVENTS = 15; // 0xf
    field public static final android.os.Parcelable.Creator<android.telephony.euicc.EuiccNotification> CREATOR;
    field public static final int EVENT_DELETE = 8; // 0x8
    field public static final int EVENT_DISABLE = 4; // 0x4
    field public static final int EVENT_ENABLE = 2; // 0x2
    field public static final int EVENT_INSTALL = 1; // 0x1
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef(flag=true, prefix={"EVENT_"}, value={android.telephony.euicc.EuiccNotification.EVENT_INSTALL, android.telephony.euicc.EuiccNotification.EVENT_ENABLE, android.telephony.euicc.EuiccNotification.EVENT_DISABLE, android.telephony.euicc.EuiccNotification.EVENT_DELETE}) public static @interface EuiccNotification.Event {
  }

  public final class EuiccRulesAuthTable implements android.os.Parcelable {
    method public int describeContents();
    method public int findIndex(@android.service.euicc.EuiccProfileInfo.PolicyRule int, android.service.carrier.CarrierIdentifier);
    method public boolean hasPolicyRuleFlag(int, @android.telephony.euicc.EuiccRulesAuthTable.PolicyRuleFlag int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.euicc.EuiccRulesAuthTable> CREATOR;
    field public static final int POLICY_RULE_FLAG_CONSENT_REQUIRED = 1; // 0x1
  }

  public static final class EuiccRulesAuthTable.Builder {
    ctor public EuiccRulesAuthTable.Builder(int);
    method public android.telephony.euicc.EuiccRulesAuthTable.Builder add(int, java.util.List<android.service.carrier.CarrierIdentifier>, int);
    method public android.telephony.euicc.EuiccRulesAuthTable build();
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef(flag=true, prefix={"POLICY_RULE_FLAG_"}, value={android.telephony.euicc.EuiccRulesAuthTable.POLICY_RULE_FLAG_CONSENT_REQUIRED}) public static @interface EuiccRulesAuthTable.PolicyRuleFlag {
  }

}

package android.telephony.ims {

  public final class ImsCallForwardInfo implements android.os.Parcelable {
    ctor public ImsCallForwardInfo(int, int, int, int, @NonNull String, int);
    method public int describeContents();
    method public int getCondition();
    method public String getNumber();
    method public int getServiceClass();
    method public int getStatus();
    method public int getTimeSeconds();
    method public int getToA();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CDIV_CF_REASON_ALL = 4; // 0x4
    field public static final int CDIV_CF_REASON_ALL_CONDITIONAL = 5; // 0x5
    field public static final int CDIV_CF_REASON_BUSY = 1; // 0x1
    field public static final int CDIV_CF_REASON_NOT_LOGGED_IN = 6; // 0x6
    field public static final int CDIV_CF_REASON_NOT_REACHABLE = 3; // 0x3
    field public static final int CDIV_CF_REASON_NO_REPLY = 2; // 0x2
    field public static final int CDIV_CF_REASON_UNCONDITIONAL = 0; // 0x0
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsCallForwardInfo> CREATOR;
    field public static final int STATUS_ACTIVE = 1; // 0x1
    field public static final int STATUS_NOT_ACTIVE = 0; // 0x0
    field public static final int TYPE_OF_ADDRESS_INTERNATIONAL = 145; // 0x91
    field public static final int TYPE_OF_ADDRESS_UNKNOWN = 129; // 0x81
  }

  public final class ImsCallProfile implements android.os.Parcelable {
    ctor public ImsCallProfile();
    ctor public ImsCallProfile(int, int);
    ctor public ImsCallProfile(int, int, android.os.Bundle, android.telephony.ims.ImsStreamMediaProfile);
    method public int describeContents();
    method public String getCallExtra(String);
    method public String getCallExtra(String, String);
    method public boolean getCallExtraBoolean(String);
    method public boolean getCallExtraBoolean(String, boolean);
    method public int getCallExtraInt(String);
    method public int getCallExtraInt(String, int);
    method public android.os.Bundle getCallExtras();
    method public int getCallType();
    method public static int getCallTypeFromVideoState(int);
    method public int getEmergencyCallRouting();
    method public int getEmergencyServiceCategories();
    method public java.util.List<java.lang.String> getEmergencyUrns();
    method public android.telephony.ims.ImsStreamMediaProfile getMediaProfile();
    method public int getRestrictCause();
    method public int getServiceType();
    method public static int getVideoStateFromCallType(int);
    method public static int getVideoStateFromImsCallProfile(android.telephony.ims.ImsCallProfile);
    method public boolean hasKnownUserIntentEmergency();
    method public boolean isEmergencyCallTesting();
    method public boolean isVideoCall();
    method public boolean isVideoPaused();
    method public static int presentationToOir(int);
    method public void setCallExtra(String, String);
    method public void setCallExtraBoolean(String, boolean);
    method public void setCallExtraInt(String, int);
    method public void setCallRestrictCause(int);
    method public void setEmergencyCallRouting(int);
    method public void setEmergencyCallTesting(boolean);
    method public void setEmergencyServiceCategories(int);
    method public void setEmergencyUrns(java.util.List<java.lang.String>);
    method public void setHasKnownUserIntentEmergency(boolean);
    method public void updateCallExtras(android.telephony.ims.ImsCallProfile);
    method public void updateCallType(android.telephony.ims.ImsCallProfile);
    method public void updateMediaProfile(android.telephony.ims.ImsCallProfile);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CALL_RESTRICT_CAUSE_DISABLED = 2; // 0x2
    field public static final int CALL_RESTRICT_CAUSE_HD = 3; // 0x3
    field public static final int CALL_RESTRICT_CAUSE_NONE = 0; // 0x0
    field public static final int CALL_RESTRICT_CAUSE_RAT = 1; // 0x1
    field public static final int CALL_TYPE_VIDEO_N_VOICE = 3; // 0x3
    field public static final int CALL_TYPE_VOICE = 2; // 0x2
    field public static final int CALL_TYPE_VOICE_N_VIDEO = 1; // 0x1
    field public static final int CALL_TYPE_VS = 8; // 0x8
    field public static final int CALL_TYPE_VS_RX = 10; // 0xa
    field public static final int CALL_TYPE_VS_TX = 9; // 0x9
    field public static final int CALL_TYPE_VT = 4; // 0x4
    field public static final int CALL_TYPE_VT_NODIR = 7; // 0x7
    field public static final int CALL_TYPE_VT_RX = 6; // 0x6
    field public static final int CALL_TYPE_VT_TX = 5; // 0x5
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsCallProfile> CREATOR;
    field public static final int DIALSTRING_NORMAL = 0; // 0x0
    field public static final int DIALSTRING_SS_CONF = 1; // 0x1
    field public static final int DIALSTRING_USSD = 2; // 0x2
    field public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo";
    field public static final String EXTRA_ADDITIONAL_SIP_INVITE_FIELDS = "android.telephony.ims.extra.ADDITIONAL_SIP_INVITE_FIELDS";
    field public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech";
    field public static final String EXTRA_CHILD_NUMBER = "ChildNum";
    field public static final String EXTRA_CNA = "cna";
    field public static final String EXTRA_CNAP = "cnap";
    field public static final String EXTRA_CODEC = "Codec";
    field public static final String EXTRA_DIALSTRING = "dialstring";
    field public static final String EXTRA_DISPLAY_TEXT = "DisplayText";
    field public static final String EXTRA_EMERGENCY_CALL = "e_call";
    field public static final String EXTRA_IS_CALL_PULL = "CallPull";
    field public static final String EXTRA_OI = "oi";
    field public static final String EXTRA_OIR = "oir";
    field public static final String EXTRA_REMOTE_URI = "remote_uri";
    field public static final String EXTRA_USSD = "ussd";
    field public static final int OIR_DEFAULT = 0; // 0x0
    field public static final int OIR_PRESENTATION_NOT_RESTRICTED = 2; // 0x2
    field public static final int OIR_PRESENTATION_PAYPHONE = 4; // 0x4
    field public static final int OIR_PRESENTATION_RESTRICTED = 1; // 0x1
    field public static final int OIR_PRESENTATION_UNKNOWN = 3; // 0x3
    field public static final int SERVICE_TYPE_EMERGENCY = 2; // 0x2
    field public static final int SERVICE_TYPE_NONE = 0; // 0x0
    field public static final int SERVICE_TYPE_NORMAL = 1; // 0x1
  }

  public class ImsCallSessionListener {
    method public void callQualityChanged(@NonNull android.telephony.CallQuality);
    method public void callSessionConferenceExtendFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionConferenceExtendReceived(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
    method public void callSessionConferenceExtended(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
    method public void callSessionConferenceStateUpdated(android.telephony.ims.ImsConferenceState);
    method public void callSessionHandover(int, int, android.telephony.ims.ImsReasonInfo);
    method public void callSessionHandoverFailed(int, int, android.telephony.ims.ImsReasonInfo);
    method public void callSessionHeld(android.telephony.ims.ImsCallProfile);
    method public void callSessionHoldFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionHoldReceived(android.telephony.ims.ImsCallProfile);
    method public void callSessionInitiated(android.telephony.ims.ImsCallProfile);
    method public void callSessionInitiatedFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionInviteParticipantsRequestDelivered();
    method public void callSessionInviteParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionMayHandover(int, int);
    method public void callSessionMergeComplete(android.telephony.ims.stub.ImsCallSessionImplBase);
    method public void callSessionMergeFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionMergeStarted(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
    method public void callSessionMultipartyStateChanged(boolean);
    method public void callSessionProgressing(android.telephony.ims.ImsStreamMediaProfile);
    method public void callSessionRemoveParticipantsRequestDelivered();
    method public void callSessionRemoveParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionResumeFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionResumeReceived(android.telephony.ims.ImsCallProfile);
    method public void callSessionResumed(android.telephony.ims.ImsCallProfile);
    method public void callSessionRttAudioIndicatorChanged(@NonNull android.telephony.ims.ImsStreamMediaProfile);
    method public void callSessionRttMessageReceived(String);
    method public void callSessionRttModifyRequestReceived(android.telephony.ims.ImsCallProfile);
    method public void callSessionRttModifyResponseReceived(int);
    method public void callSessionSuppServiceReceived(android.telephony.ims.ImsSuppServiceNotification);
    method public void callSessionTerminated(android.telephony.ims.ImsReasonInfo);
    method public void callSessionTtyModeReceived(int);
    method public void callSessionUpdateFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionUpdateReceived(android.telephony.ims.ImsCallProfile);
    method public void callSessionUpdated(android.telephony.ims.ImsCallProfile);
    method public void callSessionUssdMessageReceived(int, String);
  }

  public final class ImsConferenceState implements android.os.Parcelable {
    method public int describeContents();
    method public static int getConnectionStateForStatus(String);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsConferenceState> CREATOR;
    field public static final String DISPLAY_TEXT = "display-text";
    field public static final String ENDPOINT = "endpoint";
    field public static final String SIP_STATUS_CODE = "sipstatuscode";
    field public static final String STATUS = "status";
    field public static final String STATUS_ALERTING = "alerting";
    field public static final String STATUS_CONNECTED = "connected";
    field public static final String STATUS_CONNECT_FAIL = "connect-fail";
    field public static final String STATUS_DIALING_IN = "dialing-in";
    field public static final String STATUS_DIALING_OUT = "dialing-out";
    field public static final String STATUS_DISCONNECTED = "disconnected";
    field public static final String STATUS_DISCONNECTING = "disconnecting";
    field public static final String STATUS_MUTED_VIA_FOCUS = "muted-via-focus";
    field public static final String STATUS_ON_HOLD = "on-hold";
    field public static final String STATUS_PENDING = "pending";
    field public static final String STATUS_SEND_ONLY = "sendonly";
    field public static final String STATUS_SEND_RECV = "sendrecv";
    field public static final String USER = "user";
    field public final java.util.HashMap<java.lang.String,android.os.Bundle> mParticipants;
  }

  public class ImsException extends java.lang.Exception {
    ctor public ImsException(@Nullable String);
    ctor public ImsException(@Nullable String, int);
    ctor public ImsException(@Nullable String, int, @Nullable Throwable);
    method public int getCode();
    field public static final int CODE_ERROR_SERVICE_UNAVAILABLE = 1; // 0x1
    field public static final int CODE_ERROR_UNSPECIFIED = 0; // 0x0
    field public static final int CODE_ERROR_UNSUPPORTED_OPERATION = 2; // 0x2
  }

  public final class ImsExternalCallState implements android.os.Parcelable {
    ctor public ImsExternalCallState(@NonNull String, @NonNull android.net.Uri, @Nullable android.net.Uri, boolean, int, int, boolean);
    method public int describeContents();
    method @NonNull public android.net.Uri getAddress();
    method public int getCallId();
    method public int getCallState();
    method public int getCallType();
    method @Nullable public android.net.Uri getLocalAddress();
    method public boolean isCallHeld();
    method public boolean isCallPullable();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CALL_STATE_CONFIRMED = 1; // 0x1
    field public static final int CALL_STATE_TERMINATED = 2; // 0x2
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsExternalCallState> CREATOR;
  }

  public class ImsMmTelManager {
    method @NonNull public static android.telephony.ims.ImsMmTelManager createForSubscriptionId(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoWiFiModeSetting();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoWiFiRoamingModeSetting();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAdvancedCallingSettingEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAvailable(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isCapable(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isVoWiFiRoamingSettingEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isVoWiFiSettingEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isVtSettingEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerImsRegistrationCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback) throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerMmTelCapabilityCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ImsMmTelManager.CapabilityCallback) throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setAdvancedCallingSettingEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setRttCapabilitySetting(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiModeSetting(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiNonPersistent(boolean, int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingModeSetting(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingSettingEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiSettingEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVtSettingEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterMmTelCapabilityCallback(@NonNull android.telephony.ims.ImsMmTelManager.CapabilityCallback);
    field public static final int WIFI_MODE_CELLULAR_PREFERRED = 1; // 0x1
    field public static final int WIFI_MODE_WIFI_ONLY = 0; // 0x0
    field public static final int WIFI_MODE_WIFI_PREFERRED = 2; // 0x2
  }

  public static class ImsMmTelManager.CapabilityCallback {
    ctor public ImsMmTelManager.CapabilityCallback();
    method public void onCapabilitiesStatusChanged(@NonNull android.telephony.ims.feature.MmTelFeature.MmTelCapabilities);
  }

  public static class ImsMmTelManager.RegistrationCallback {
    ctor public ImsMmTelManager.RegistrationCallback();
    method public void onRegistered(int);
    method public void onRegistering(int);
    method public void onTechnologyChangeFailed(int, @Nullable android.telephony.ims.ImsReasonInfo);
    method public void onUnregistered(@Nullable android.telephony.ims.ImsReasonInfo);
  }

  public final class ImsReasonInfo implements android.os.Parcelable {
    ctor public ImsReasonInfo(int, int, String);
    method public int describeContents();
    method public int getCode();
    method public int getExtraCode();
    method public String getExtraMessage();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CODE_ACCESS_CLASS_BLOCKED = 1512; // 0x5e8
    field public static final int CODE_ANSWERED_ELSEWHERE = 1014; // 0x3f6
    field public static final int CODE_BLACKLISTED_CALL_ID = 506; // 0x1fa
    field public static final int CODE_CALL_BARRED = 240; // 0xf0
    field public static final int CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE = 1100; // 0x44c
    field public static final int CODE_CALL_END_CAUSE_CALL_PULL = 1016; // 0x3f8
    field public static final int CODE_CALL_PULL_OUT_OF_SYNC = 1015; // 0x3f7
    field public static final int CODE_DATA_DISABLED = 1406; // 0x57e
    field public static final int CODE_DATA_LIMIT_REACHED = 1405; // 0x57d
    field public static final int CODE_DIAL_MODIFIED_TO_DIAL = 246; // 0xf6
    field public static final int CODE_DIAL_MODIFIED_TO_DIAL_VIDEO = 247; // 0xf7
    field public static final int CODE_DIAL_MODIFIED_TO_SS = 245; // 0xf5
    field public static final int CODE_DIAL_MODIFIED_TO_USSD = 244; // 0xf4
    field public static final int CODE_DIAL_VIDEO_MODIFIED_TO_DIAL = 248; // 0xf8
    field public static final int CODE_DIAL_VIDEO_MODIFIED_TO_DIAL_VIDEO = 249; // 0xf9
    field public static final int CODE_DIAL_VIDEO_MODIFIED_TO_SS = 250; // 0xfa
    field public static final int CODE_DIAL_VIDEO_MODIFIED_TO_USSD = 251; // 0xfb
    field public static final int CODE_ECBM_NOT_SUPPORTED = 901; // 0x385
    field public static final int CODE_EMERGENCY_PERM_FAILURE = 364; // 0x16c
    field public static final int CODE_EMERGENCY_TEMP_FAILURE = 363; // 0x16b
    field public static final int CODE_EPDG_TUNNEL_ESTABLISH_FAILURE = 1400; // 0x578
    field public static final int CODE_EPDG_TUNNEL_LOST_CONNECTION = 1402; // 0x57a
    field public static final int CODE_EPDG_TUNNEL_REKEY_FAILURE = 1401; // 0x579
    field public static final int CODE_FDN_BLOCKED = 241; // 0xf1
    field public static final int CODE_IKEV2_AUTH_FAILURE = 1408; // 0x580
    field public static final int CODE_IMEI_NOT_ACCEPTED = 243; // 0xf3
    field public static final int CODE_IWLAN_DPD_FAILURE = 1300; // 0x514
    field public static final int CODE_LOCAL_CALL_BUSY = 142; // 0x8e
    field public static final int CODE_LOCAL_CALL_CS_RETRY_REQUIRED = 146; // 0x92
    field public static final int CODE_LOCAL_CALL_DECLINE = 143; // 0x8f
    field public static final int CODE_LOCAL_CALL_EXCEEDED = 141; // 0x8d
    field public static final int CODE_LOCAL_CALL_RESOURCE_RESERVATION_FAILED = 145; // 0x91
    field public static final int CODE_LOCAL_CALL_TERMINATED = 148; // 0x94
    field public static final int CODE_LOCAL_CALL_VCC_ON_PROGRESSING = 144; // 0x90
    field public static final int CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED = 147; // 0x93
    field public static final int CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE = 108; // 0x6c
    field public static final int CODE_LOCAL_HO_NOT_FEASIBLE = 149; // 0x95
    field public static final int CODE_LOCAL_ILLEGAL_ARGUMENT = 101; // 0x65
    field public static final int CODE_LOCAL_ILLEGAL_STATE = 102; // 0x66
    field public static final int CODE_LOCAL_IMS_SERVICE_DOWN = 106; // 0x6a
    field public static final int CODE_LOCAL_INTERNAL_ERROR = 103; // 0x67
    field public static final int CODE_LOCAL_LOW_BATTERY = 112; // 0x70
    field public static final int CODE_LOCAL_NETWORK_IP_CHANGED = 124; // 0x7c
    field public static final int CODE_LOCAL_NETWORK_NO_LTE_COVERAGE = 122; // 0x7a
    field public static final int CODE_LOCAL_NETWORK_NO_SERVICE = 121; // 0x79
    field public static final int CODE_LOCAL_NETWORK_ROAMING = 123; // 0x7b
    field public static final int CODE_LOCAL_NOT_REGISTERED = 132; // 0x84
    field public static final int CODE_LOCAL_NO_PENDING_CALL = 107; // 0x6b
    field public static final int CODE_LOCAL_POWER_OFF = 111; // 0x6f
    field public static final int CODE_LOCAL_SERVICE_UNAVAILABLE = 131; // 0x83
    field public static final int CODE_LOW_BATTERY = 505; // 0x1f9
    field public static final int CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED = 1403; // 0x57b
    field public static final int CODE_MEDIA_INIT_FAILED = 401; // 0x191
    field public static final int CODE_MEDIA_NOT_ACCEPTABLE = 403; // 0x193
    field public static final int CODE_MEDIA_NO_DATA = 402; // 0x192
    field public static final int CODE_MEDIA_UNSPECIFIED = 404; // 0x194
    field public static final int CODE_MULTIENDPOINT_NOT_SUPPORTED = 902; // 0x386
    field public static final int CODE_NETWORK_DETACH = 1513; // 0x5e9
    field public static final int CODE_NETWORK_REJECT = 1504; // 0x5e0
    field public static final int CODE_NETWORK_RESP_TIMEOUT = 1503; // 0x5df
    field public static final int CODE_NO_CSFB_IN_CS_ROAM = 1516; // 0x5ec
    field public static final int CODE_NO_VALID_SIM = 1501; // 0x5dd
    field public static final int CODE_OEM_CAUSE_1 = 61441; // 0xf001
    field public static final int CODE_OEM_CAUSE_10 = 61450; // 0xf00a
    field public static final int CODE_OEM_CAUSE_11 = 61451; // 0xf00b
    field public static final int CODE_OEM_CAUSE_12 = 61452; // 0xf00c
    field public static final int CODE_OEM_CAUSE_13 = 61453; // 0xf00d
    field public static final int CODE_OEM_CAUSE_14 = 61454; // 0xf00e
    field public static final int CODE_OEM_CAUSE_15 = 61455; // 0xf00f
    field public static final int CODE_OEM_CAUSE_2 = 61442; // 0xf002
    field public static final int CODE_OEM_CAUSE_3 = 61443; // 0xf003
    field public static final int CODE_OEM_CAUSE_4 = 61444; // 0xf004
    field public static final int CODE_OEM_CAUSE_5 = 61445; // 0xf005
    field public static final int CODE_OEM_CAUSE_6 = 61446; // 0xf006
    field public static final int CODE_OEM_CAUSE_7 = 61447; // 0xf007
    field public static final int CODE_OEM_CAUSE_8 = 61448; // 0xf008
    field public static final int CODE_OEM_CAUSE_9 = 61449; // 0xf009
    field public static final int CODE_RADIO_ACCESS_FAILURE = 1505; // 0x5e1
    field public static final int CODE_RADIO_INTERNAL_ERROR = 1502; // 0x5de
    field public static final int CODE_RADIO_LINK_FAILURE = 1506; // 0x5e2
    field public static final int CODE_RADIO_LINK_LOST = 1507; // 0x5e3
    field public static final int CODE_RADIO_OFF = 1500; // 0x5dc
    field public static final int CODE_RADIO_RELEASE_ABNORMAL = 1511; // 0x5e7
    field public static final int CODE_RADIO_RELEASE_NORMAL = 1510; // 0x5e6
    field public static final int CODE_RADIO_SETUP_FAILURE = 1509; // 0x5e5
    field public static final int CODE_RADIO_UPLINK_FAILURE = 1508; // 0x5e4
    field public static final int CODE_REGISTRATION_ERROR = 1000; // 0x3e8
    field public static final int CODE_REJECTED_ELSEWHERE = 1017; // 0x3f9
    field public static final int CODE_REJECT_1X_COLLISION = 1603; // 0x643
    field public static final int CODE_REJECT_CALL_ON_OTHER_SUB = 1602; // 0x642
    field public static final int CODE_REJECT_CALL_TYPE_NOT_ALLOWED = 1605; // 0x645
    field public static final int CODE_REJECT_CONFERENCE_TTY_NOT_ALLOWED = 1617; // 0x651
    field public static final int CODE_REJECT_INTERNAL_ERROR = 1612; // 0x64c
    field public static final int CODE_REJECT_MAX_CALL_LIMIT_REACHED = 1608; // 0x648
    field public static final int CODE_REJECT_ONGOING_CALL_SETUP = 1607; // 0x647
    field public static final int CODE_REJECT_ONGOING_CALL_TRANSFER = 1611; // 0x64b
    field public static final int CODE_REJECT_ONGOING_CALL_UPGRADE = 1616; // 0x650
    field public static final int CODE_REJECT_ONGOING_CALL_WAITING_DISABLED = 1601; // 0x641
    field public static final int CODE_REJECT_ONGOING_CONFERENCE_CALL = 1618; // 0x652
    field public static final int CODE_REJECT_ONGOING_CS_CALL = 1621; // 0x655
    field public static final int CODE_REJECT_ONGOING_E911_CALL = 1606; // 0x646
    field public static final int CODE_REJECT_ONGOING_ENCRYPTED_CALL = 1620; // 0x654
    field public static final int CODE_REJECT_ONGOING_HANDOVER = 1614; // 0x64e
    field public static final int CODE_REJECT_QOS_FAILURE = 1613; // 0x64d
    field public static final int CODE_REJECT_SERVICE_NOT_REGISTERED = 1604; // 0x644
    field public static final int CODE_REJECT_UNKNOWN = 1600; // 0x640
    field public static final int CODE_REJECT_UNSUPPORTED_SDP_HEADERS = 1610; // 0x64a
    field public static final int CODE_REJECT_UNSUPPORTED_SIP_HEADERS = 1609; // 0x649
    field public static final int CODE_REJECT_VT_AVPF_NOT_ALLOWED = 1619; // 0x653
    field public static final int CODE_REJECT_VT_TTY_NOT_ALLOWED = 1615; // 0x64f
    field public static final int CODE_REMOTE_CALL_DECLINE = 1404; // 0x57c
    field public static final int CODE_SESSION_MODIFICATION_FAILED = 1517; // 0x5ed
    field public static final int CODE_SIP_ALTERNATE_EMERGENCY_CALL = 1514; // 0x5ea
    field public static final int CODE_SIP_AMBIGUOUS = 376; // 0x178
    field public static final int CODE_SIP_BAD_ADDRESS = 337; // 0x151
    field public static final int CODE_SIP_BAD_REQUEST = 331; // 0x14b
    field public static final int CODE_SIP_BUSY = 338; // 0x152
    field public static final int CODE_SIP_CALL_OR_TRANS_DOES_NOT_EXIST = 372; // 0x174
    field public static final int CODE_SIP_CLIENT_ERROR = 342; // 0x156
    field public static final int CODE_SIP_EXTENSION_REQUIRED = 370; // 0x172
    field public static final int CODE_SIP_FORBIDDEN = 332; // 0x14c
    field public static final int CODE_SIP_GLOBAL_ERROR = 362; // 0x16a
    field public static final int CODE_SIP_INTERVAL_TOO_BRIEF = 371; // 0x173
    field public static final int CODE_SIP_LOOP_DETECTED = 373; // 0x175
    field public static final int CODE_SIP_METHOD_NOT_ALLOWED = 366; // 0x16e
    field public static final int CODE_SIP_NOT_ACCEPTABLE = 340; // 0x154
    field public static final int CODE_SIP_NOT_FOUND = 333; // 0x14d
    field public static final int CODE_SIP_NOT_REACHABLE = 341; // 0x155
    field public static final int CODE_SIP_NOT_SUPPORTED = 334; // 0x14e
    field public static final int CODE_SIP_PROXY_AUTHENTICATION_REQUIRED = 367; // 0x16f
    field public static final int CODE_SIP_REDIRECTED = 321; // 0x141
    field public static final int CODE_SIP_REQUEST_CANCELLED = 339; // 0x153
    field public static final int CODE_SIP_REQUEST_ENTITY_TOO_LARGE = 368; // 0x170
    field public static final int CODE_SIP_REQUEST_PENDING = 377; // 0x179
    field public static final int CODE_SIP_REQUEST_TIMEOUT = 335; // 0x14f
    field public static final int CODE_SIP_REQUEST_URI_TOO_LARGE = 369; // 0x171
    field public static final int CODE_SIP_SERVER_ERROR = 354; // 0x162
    field public static final int CODE_SIP_SERVER_INTERNAL_ERROR = 351; // 0x15f
    field public static final int CODE_SIP_SERVER_TIMEOUT = 353; // 0x161
    field public static final int CODE_SIP_SERVICE_UNAVAILABLE = 352; // 0x160
    field public static final int CODE_SIP_TEMPRARILY_UNAVAILABLE = 336; // 0x150
    field public static final int CODE_SIP_TOO_MANY_HOPS = 374; // 0x176
    field public static final int CODE_SIP_TRANSACTION_DOES_NOT_EXIST = 343; // 0x157
    field public static final int CODE_SIP_UNDECIPHERABLE = 378; // 0x17a
    field public static final int CODE_SIP_USER_MARKED_UNWANTED = 365; // 0x16d
    field public static final int CODE_SIP_USER_REJECTED = 361; // 0x169
    field public static final int CODE_SUPP_SVC_CANCELLED = 1202; // 0x4b2
    field public static final int CODE_SUPP_SVC_FAILED = 1201; // 0x4b1
    field public static final int CODE_SUPP_SVC_REINVITE_COLLISION = 1203; // 0x4b3
    field public static final int CODE_TIMEOUT_1XX_WAITING = 201; // 0xc9
    field public static final int CODE_TIMEOUT_NO_ANSWER = 202; // 0xca
    field public static final int CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE = 203; // 0xcb
    field public static final int CODE_UNSPECIFIED = 0; // 0x0
    field public static final int CODE_USER_CANCELLED_SESSION_MODIFICATION = 512; // 0x200
    field public static final int CODE_USER_DECLINE = 504; // 0x1f8
    field public static final int CODE_USER_IGNORE = 503; // 0x1f7
    field public static final int CODE_USER_NOANSWER = 502; // 0x1f6
    field public static final int CODE_USER_REJECTED_SESSION_MODIFICATION = 511; // 0x1ff
    field public static final int CODE_USER_TERMINATED = 501; // 0x1f5
    field public static final int CODE_USER_TERMINATED_BY_REMOTE = 510; // 0x1fe
    field public static final int CODE_UT_CB_PASSWORD_MISMATCH = 821; // 0x335
    field public static final int CODE_UT_NETWORK_ERROR = 804; // 0x324
    field public static final int CODE_UT_NOT_SUPPORTED = 801; // 0x321
    field public static final int CODE_UT_OPERATION_NOT_ALLOWED = 803; // 0x323
    field public static final int CODE_UT_SERVICE_UNAVAILABLE = 802; // 0x322
    field public static final int CODE_UT_SS_MODIFIED_TO_DIAL = 822; // 0x336
    field public static final int CODE_UT_SS_MODIFIED_TO_DIAL_VIDEO = 825; // 0x339
    field public static final int CODE_UT_SS_MODIFIED_TO_SS = 824; // 0x338
    field public static final int CODE_UT_SS_MODIFIED_TO_USSD = 823; // 0x337
    field public static final int CODE_WIFI_LOST = 1407; // 0x57f
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsReasonInfo> CREATOR;
    field public static final int EXTRA_CODE_CALL_RETRY_BY_SETTINGS = 3; // 0x3
    field public static final int EXTRA_CODE_CALL_RETRY_NORMAL = 1; // 0x1
    field public static final int EXTRA_CODE_CALL_RETRY_SILENT_REDIAL = 2; // 0x2
    field public static final String EXTRA_MSG_SERVICE_NOT_AUTHORIZED = "Forbidden. Not Authorized for Service";
  }

  public class ImsService extends android.app.Service {
    ctor public ImsService();
    method public android.telephony.ims.feature.MmTelFeature createMmTelFeature(int);
    method public android.telephony.ims.feature.RcsFeature createRcsFeature(int);
    method public void disableIms(int);
    method public void enableIms(int);
    method public android.telephony.ims.stub.ImsConfigImplBase getConfig(int);
    method public android.telephony.ims.stub.ImsRegistrationImplBase getRegistration(int);
    method public final void onUpdateSupportedImsFeatures(android.telephony.ims.stub.ImsFeatureConfiguration) throws android.os.RemoteException;
    method public android.telephony.ims.stub.ImsFeatureConfiguration querySupportedImsFeatures();
    method public void readyForFeatureCreation();
  }

  public final class ImsSsData implements android.os.Parcelable {
    ctor public ImsSsData(int, int, int, int, int);
    method public int describeContents();
    method @Nullable public java.util.List<android.telephony.ims.ImsCallForwardInfo> getCallForwardInfo();
    method public int getRequestType();
    method public int getResult();
    method public int getServiceClass();
    method public int getServiceType();
    method @NonNull public java.util.List<android.telephony.ims.ImsSsInfo> getSuppServiceInfo();
    method public int getTeleserviceType();
    method public boolean isTypeBarring();
    method public boolean isTypeCf();
    method public boolean isTypeClip();
    method public boolean isTypeClir();
    method public boolean isTypeColp();
    method public boolean isTypeColr();
    method public boolean isTypeCw();
    method public boolean isTypeIcb();
    method public boolean isTypeInterrogation();
    method public boolean isTypeUnConditional();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSsData> CREATOR;
    field public static final int RESULT_SUCCESS = 0; // 0x0
    field public static final int SERVICE_CLASS_DATA = 2; // 0x2
    field public static final int SERVICE_CLASS_DATA_CIRCUIT_ASYNC = 32; // 0x20
    field public static final int SERVICE_CLASS_DATA_CIRCUIT_SYNC = 16; // 0x10
    field public static final int SERVICE_CLASS_DATA_PACKET_ACCESS = 64; // 0x40
    field public static final int SERVICE_CLASS_DATA_PAD = 128; // 0x80
    field public static final int SERVICE_CLASS_FAX = 4; // 0x4
    field public static final int SERVICE_CLASS_NONE = 0; // 0x0
    field public static final int SERVICE_CLASS_SMS = 8; // 0x8
    field public static final int SERVICE_CLASS_VOICE = 1; // 0x1
    field public static final int SS_ACTIVATION = 0; // 0x0
    field public static final int SS_ALL_BARRING = 18; // 0x12
    field public static final int SS_ALL_DATA_TELESERVICES = 3; // 0x3
    field public static final int SS_ALL_TELESERVICES_EXCEPT_SMS = 5; // 0x5
    field public static final int SS_ALL_TELESEVICES = 1; // 0x1
    field public static final int SS_ALL_TELE_AND_BEARER_SERVICES = 0; // 0x0
    field public static final int SS_BAIC = 16; // 0x10
    field public static final int SS_BAIC_ROAMING = 17; // 0x11
    field public static final int SS_BAOC = 13; // 0xd
    field public static final int SS_BAOIC = 14; // 0xe
    field public static final int SS_BAOIC_EXC_HOME = 15; // 0xf
    field public static final int SS_CFU = 0; // 0x0
    field public static final int SS_CFUT = 6; // 0x6
    field public static final int SS_CF_ALL = 4; // 0x4
    field public static final int SS_CF_ALL_CONDITIONAL = 5; // 0x5
    field public static final int SS_CF_BUSY = 1; // 0x1
    field public static final int SS_CF_NOT_REACHABLE = 3; // 0x3
    field public static final int SS_CF_NO_REPLY = 2; // 0x2
    field public static final int SS_CLIP = 7; // 0x7
    field public static final int SS_CLIR = 8; // 0x8
    field public static final int SS_CNAP = 11; // 0xb
    field public static final int SS_COLP = 9; // 0x9
    field public static final int SS_COLR = 10; // 0xa
    field public static final int SS_DEACTIVATION = 1; // 0x1
    field public static final int SS_ERASURE = 4; // 0x4
    field public static final int SS_INCOMING_BARRING = 20; // 0x14
    field public static final int SS_INCOMING_BARRING_ANONYMOUS = 22; // 0x16
    field public static final int SS_INCOMING_BARRING_DN = 21; // 0x15
    field public static final int SS_INTERROGATION = 2; // 0x2
    field public static final int SS_OUTGOING_BARRING = 19; // 0x13
    field public static final int SS_REGISTRATION = 3; // 0x3
    field public static final int SS_SMS_SERVICES = 4; // 0x4
    field public static final int SS_TELEPHONY = 2; // 0x2
    field public static final int SS_WAIT = 12; // 0xc
  }

  public static final class ImsSsData.Builder {
    ctor public ImsSsData.Builder(int, int, int, int, int);
    method @NonNull public android.telephony.ims.ImsSsData build();
    method @NonNull public android.telephony.ims.ImsSsData.Builder setCallForwardingInfo(@NonNull java.util.List<android.telephony.ims.ImsCallForwardInfo>);
    method @NonNull public android.telephony.ims.ImsSsData.Builder setSuppServiceInfo(@NonNull java.util.List<android.telephony.ims.ImsSsInfo>);
  }

  public final class ImsSsInfo implements android.os.Parcelable {
    ctor @Deprecated public ImsSsInfo(int, @Nullable String);
    method public int describeContents();
    method public int getClirInterrogationStatus();
    method public int getClirOutgoingState();
    method @Deprecated public String getIcbNum();
    method @Nullable public String getIncomingCommunicationBarringNumber();
    method public int getProvisionStatus();
    method public int getStatus();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CLIR_OUTGOING_DEFAULT = 0; // 0x0
    field public static final int CLIR_OUTGOING_INVOCATION = 1; // 0x1
    field public static final int CLIR_OUTGOING_SUPPRESSION = 2; // 0x2
    field public static final int CLIR_STATUS_NOT_PROVISIONED = 0; // 0x0
    field public static final int CLIR_STATUS_PROVISIONED_PERMANENT = 1; // 0x1
    field public static final int CLIR_STATUS_TEMPORARILY_ALLOWED = 4; // 0x4
    field public static final int CLIR_STATUS_TEMPORARILY_RESTRICTED = 3; // 0x3
    field public static final int CLIR_STATUS_UNKNOWN = 2; // 0x2
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSsInfo> CREATOR;
    field public static final int DISABLED = 0; // 0x0
    field public static final int ENABLED = 1; // 0x1
    field public static final int NOT_REGISTERED = -1; // 0xffffffff
    field public static final int SERVICE_NOT_PROVISIONED = 0; // 0x0
    field public static final int SERVICE_PROVISIONED = 1; // 0x1
    field public static final int SERVICE_PROVISIONING_UNKNOWN = -1; // 0xffffffff
  }

  public static final class ImsSsInfo.Builder {
    ctor public ImsSsInfo.Builder(int);
    method @NonNull public android.telephony.ims.ImsSsInfo build();
    method @NonNull public android.telephony.ims.ImsSsInfo.Builder setClirInterrogationStatus(int);
    method @NonNull public android.telephony.ims.ImsSsInfo.Builder setClirOutgoingState(int);
    method @NonNull public android.telephony.ims.ImsSsInfo.Builder setIncomingCommunicationBarringNumber(@NonNull String);
    method @NonNull public android.telephony.ims.ImsSsInfo.Builder setProvisionStatus(int);
  }

  public final class ImsStreamMediaProfile implements android.os.Parcelable {
    ctor public ImsStreamMediaProfile(int, int, int, int, int);
    method public void copyFrom(android.telephony.ims.ImsStreamMediaProfile);
    method public int describeContents();
    method public int getAudioDirection();
    method public int getAudioQuality();
    method public int getRttMode();
    method public int getVideoDirection();
    method public int getVideoQuality();
    method public boolean isReceivingRttAudio();
    method public boolean isRttCall();
    method public void setReceivingRttAudio(boolean);
    method public void setRttMode(int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int AUDIO_QUALITY_AMR = 1; // 0x1
    field public static final int AUDIO_QUALITY_AMR_WB = 2; // 0x2
    field public static final int AUDIO_QUALITY_EVRC = 4; // 0x4
    field public static final int AUDIO_QUALITY_EVRC_B = 5; // 0x5
    field public static final int AUDIO_QUALITY_EVRC_NW = 7; // 0x7
    field public static final int AUDIO_QUALITY_EVRC_WB = 6; // 0x6
    field public static final int AUDIO_QUALITY_EVS_FB = 20; // 0x14
    field public static final int AUDIO_QUALITY_EVS_NB = 17; // 0x11
    field public static final int AUDIO_QUALITY_EVS_SWB = 19; // 0x13
    field public static final int AUDIO_QUALITY_EVS_WB = 18; // 0x12
    field public static final int AUDIO_QUALITY_G711A = 13; // 0xd
    field public static final int AUDIO_QUALITY_G711AB = 15; // 0xf
    field public static final int AUDIO_QUALITY_G711U = 11; // 0xb
    field public static final int AUDIO_QUALITY_G722 = 14; // 0xe
    field public static final int AUDIO_QUALITY_G723 = 12; // 0xc
    field public static final int AUDIO_QUALITY_G729 = 16; // 0x10
    field public static final int AUDIO_QUALITY_GSM_EFR = 8; // 0x8
    field public static final int AUDIO_QUALITY_GSM_FR = 9; // 0x9
    field public static final int AUDIO_QUALITY_GSM_HR = 10; // 0xa
    field public static final int AUDIO_QUALITY_NONE = 0; // 0x0
    field public static final int AUDIO_QUALITY_QCELP13K = 3; // 0x3
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsStreamMediaProfile> CREATOR;
    field public static final int DIRECTION_INACTIVE = 0; // 0x0
    field public static final int DIRECTION_INVALID = -1; // 0xffffffff
    field public static final int DIRECTION_RECEIVE = 1; // 0x1
    field public static final int DIRECTION_SEND = 2; // 0x2
    field public static final int DIRECTION_SEND_RECEIVE = 3; // 0x3
    field public static final int RTT_MODE_DISABLED = 0; // 0x0
    field public static final int RTT_MODE_FULL = 1; // 0x1
    field public static final int VIDEO_QUALITY_NONE = 0; // 0x0
    field public static final int VIDEO_QUALITY_QCIF = 1; // 0x1
    field public static final int VIDEO_QUALITY_QVGA_LANDSCAPE = 2; // 0x2
    field public static final int VIDEO_QUALITY_QVGA_PORTRAIT = 4; // 0x4
    field public static final int VIDEO_QUALITY_VGA_LANDSCAPE = 8; // 0x8
    field public static final int VIDEO_QUALITY_VGA_PORTRAIT = 16; // 0x10
  }

  public final class ImsSuppServiceNotification implements android.os.Parcelable {
    ctor public ImsSuppServiceNotification(int, int, int, int, String, String[]);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.ims.ImsSuppServiceNotification> CREATOR;
    field public final int code;
    field public final String[] history;
    field public final int index;
    field public final int notificationType;
    field public final String number;
    field public final int type;
  }

  public class ImsUtListener {
    method public void onSupplementaryServiceIndication(android.telephony.ims.ImsSsData);
    method public void onUtConfigurationCallBarringQueried(int, android.telephony.ims.ImsSsInfo[]);
    method public void onUtConfigurationCallForwardQueried(int, android.telephony.ims.ImsCallForwardInfo[]);
    method public void onUtConfigurationCallWaitingQueried(int, android.telephony.ims.ImsSsInfo[]);
    method public void onUtConfigurationQueried(int, android.os.Bundle);
    method public void onUtConfigurationQueryFailed(int, android.telephony.ims.ImsReasonInfo);
    method public void onUtConfigurationUpdateFailed(int, android.telephony.ims.ImsReasonInfo);
    method public void onUtConfigurationUpdated(int);
  }

  public abstract class ImsVideoCallProvider {
    ctor public ImsVideoCallProvider();
    method public void changeCallDataUsage(long);
    method public void changeCameraCapabilities(android.telecom.VideoProfile.CameraCapabilities);
    method public void changePeerDimensions(int, int);
    method public void changeVideoQuality(int);
    method public void handleCallSessionEvent(int);
    method public abstract void onRequestCallDataUsage();
    method public abstract void onRequestCameraCapabilities();
    method public abstract void onSendSessionModifyRequest(android.telecom.VideoProfile, android.telecom.VideoProfile);
    method public abstract void onSendSessionModifyResponse(android.telecom.VideoProfile);
    method public abstract void onSetCamera(String);
    method public void onSetCamera(String, int);
    method public abstract void onSetDeviceOrientation(int);
    method public abstract void onSetDisplaySurface(android.view.Surface);
    method public abstract void onSetPauseImage(android.net.Uri);
    method public abstract void onSetPreviewSurface(android.view.Surface);
    method public abstract void onSetZoom(float);
    method public void receiveSessionModifyRequest(android.telecom.VideoProfile);
    method public void receiveSessionModifyResponse(int, android.telecom.VideoProfile, android.telecom.VideoProfile);
  }

  public class ProvisioningManager {
    method @NonNull public static android.telephony.ims.ProvisioningManager createForSubscriptionId(int);
    method @WorkerThread @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getProvisioningIntValue(int);
    method @WorkerThread @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getProvisioningStatusForCapability(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public String getProvisioningStringValue(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerProvisioningChangedCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ProvisioningManager.Callback) throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public int setProvisioningIntValue(int, int);
    method @WorkerThread @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setProvisioningStatusForCapability(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public int setProvisioningStringValue(int, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterProvisioningChangedCallback(@NonNull android.telephony.ims.ProvisioningManager.Callback);
    field public static final int KEY_VOICE_OVER_WIFI_MODE_OVERRIDE = 27; // 0x1b
    field public static final int KEY_VOICE_OVER_WIFI_ROAMING_ENABLED_OVERRIDE = 26; // 0x1a
    field public static final int PROVISIONING_VALUE_DISABLED = 0; // 0x0
    field public static final int PROVISIONING_VALUE_ENABLED = 1; // 0x1
    field public static final String STRING_QUERY_RESULT_ERROR_GENERIC = "STRING_QUERY_RESULT_ERROR_GENERIC";
    field public static final String STRING_QUERY_RESULT_ERROR_NOT_READY = "STRING_QUERY_RESULT_ERROR_NOT_READY";
  }

  public static class ProvisioningManager.Callback {
    ctor public ProvisioningManager.Callback();
    method public void onProvisioningIntChanged(int, int);
    method public void onProvisioningStringChanged(int, String);
  }

}

package android.telephony.ims.feature {

  public final class CapabilityChangeRequest implements android.os.Parcelable {
    method public void addCapabilitiesToDisableForTech(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
    method public void addCapabilitiesToEnableForTech(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
    method public int describeContents();
    method public java.util.List<android.telephony.ims.feature.CapabilityChangeRequest.CapabilityPair> getCapabilitiesToDisable();
    method public java.util.List<android.telephony.ims.feature.CapabilityChangeRequest.CapabilityPair> getCapabilitiesToEnable();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.ims.feature.CapabilityChangeRequest> CREATOR;
  }

  public static class CapabilityChangeRequest.CapabilityPair {
    ctor public CapabilityChangeRequest.CapabilityPair(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
    method @android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability public int getCapability();
    method public int getRadioTech();
  }

  public abstract class ImsFeature {
    ctor public ImsFeature();
    method public abstract void changeEnabledCapabilities(android.telephony.ims.feature.CapabilityChangeRequest, android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
    method public abstract void onFeatureReady();
    method public abstract void onFeatureRemoved();
    method public final void setFeatureState(int);
    field public static final int CAPABILITY_ERROR_GENERIC = -1; // 0xffffffff
    field public static final int CAPABILITY_SUCCESS = 0; // 0x0
    field public static final int FEATURE_EMERGENCY_MMTEL = 0; // 0x0
    field public static final int FEATURE_MMTEL = 1; // 0x1
    field public static final int FEATURE_RCS = 2; // 0x2
    field public static final int STATE_INITIALIZING = 1; // 0x1
    field public static final int STATE_READY = 2; // 0x2
    field public static final int STATE_UNAVAILABLE = 0; // 0x0
  }

  public static class ImsFeature.Capabilities {
    field protected int mCapabilities;
  }

  protected static class ImsFeature.CapabilityCallbackProxy {
    method public void onChangeCapabilityConfigurationError(int, int, int);
  }

  public class MmTelFeature extends android.telephony.ims.feature.ImsFeature {
    ctor public MmTelFeature();
    method public void changeEnabledCapabilities(@NonNull android.telephony.ims.feature.CapabilityChangeRequest, @NonNull android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
    method @Nullable public android.telephony.ims.ImsCallProfile createCallProfile(int, int);
    method @Nullable public android.telephony.ims.stub.ImsCallSessionImplBase createCallSession(@NonNull android.telephony.ims.ImsCallProfile);
    method @NonNull public android.telephony.ims.stub.ImsEcbmImplBase getEcbm();
    method @NonNull public android.telephony.ims.stub.ImsMultiEndpointImplBase getMultiEndpoint();
    method @NonNull public android.telephony.ims.stub.ImsSmsImplBase getSmsImplementation();
    method @NonNull public android.telephony.ims.stub.ImsUtImplBase getUt();
    method public final void notifyCapabilitiesStatusChanged(@NonNull android.telephony.ims.feature.MmTelFeature.MmTelCapabilities);
    method public final void notifyIncomingCall(@NonNull android.telephony.ims.stub.ImsCallSessionImplBase, @NonNull android.os.Bundle);
    method public final void notifyRejectedCall(@NonNull android.telephony.ims.ImsCallProfile, @NonNull android.telephony.ims.ImsReasonInfo);
    method public final void notifyVoiceMessageCountUpdate(int);
    method public void onFeatureReady();
    method public void onFeatureRemoved();
    method public boolean queryCapabilityConfiguration(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
    method public final android.telephony.ims.feature.MmTelFeature.MmTelCapabilities queryCapabilityStatus();
    method public void setUiTtyMode(int, @Nullable android.os.Message);
    method @android.telephony.ims.feature.MmTelFeature.ProcessCallResult public int shouldProcessCall(@NonNull String[]);
    field public static final int PROCESS_CALL_CSFB = 1; // 0x1
    field public static final int PROCESS_CALL_IMS = 0; // 0x0
  }

  public static class MmTelFeature.MmTelCapabilities extends android.telephony.ims.feature.ImsFeature.Capabilities {
    ctor public MmTelFeature.MmTelCapabilities();
    ctor @Deprecated public MmTelFeature.MmTelCapabilities(android.telephony.ims.feature.ImsFeature.Capabilities);
    ctor public MmTelFeature.MmTelCapabilities(int);
    method public final void addCapabilities(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int);
    method public final boolean isCapable(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int);
    method public final void removeCapabilities(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int);
    field public static final int CAPABILITY_TYPE_SMS = 8; // 0x8
    field public static final int CAPABILITY_TYPE_UT = 4; // 0x4
    field public static final int CAPABILITY_TYPE_VIDEO = 2; // 0x2
    field public static final int CAPABILITY_TYPE_VOICE = 1; // 0x1
  }

  @IntDef(flag=true, value={android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_VOICE, android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_VIDEO, android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_UT, android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_SMS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface MmTelFeature.MmTelCapabilities.MmTelCapability {
  }

  @IntDef(flag=true, value={android.telephony.ims.feature.MmTelFeature.PROCESS_CALL_IMS, android.telephony.ims.feature.MmTelFeature.PROCESS_CALL_CSFB}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface MmTelFeature.ProcessCallResult {
  }

  public class RcsFeature extends android.telephony.ims.feature.ImsFeature {
    ctor public RcsFeature();
    method public void changeEnabledCapabilities(android.telephony.ims.feature.CapabilityChangeRequest, android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
    method public void onFeatureReady();
    method public void onFeatureRemoved();
  }

}

package android.telephony.ims.stub {

  public class ImsCallSessionImplBase implements java.lang.AutoCloseable {
    ctor public ImsCallSessionImplBase();
    method public void accept(int, android.telephony.ims.ImsStreamMediaProfile);
    method public void close();
    method public void deflect(String);
    method public void extendToConference(String[]);
    method public String getCallId();
    method public android.telephony.ims.ImsCallProfile getCallProfile();
    method public android.telephony.ims.ImsVideoCallProvider getImsVideoCallProvider();
    method public android.telephony.ims.ImsCallProfile getLocalCallProfile();
    method public String getProperty(String);
    method public android.telephony.ims.ImsCallProfile getRemoteCallProfile();
    method public int getState();
    method public void hold(android.telephony.ims.ImsStreamMediaProfile);
    method public void inviteParticipants(String[]);
    method public boolean isInCall();
    method public boolean isMultiparty();
    method public void merge();
    method public void reject(int);
    method public void removeParticipants(String[]);
    method public void resume(android.telephony.ims.ImsStreamMediaProfile);
    method public void sendDtmf(char, android.os.Message);
    method public void sendRttMessage(String);
    method public void sendRttModifyRequest(android.telephony.ims.ImsCallProfile);
    method public void sendRttModifyResponse(boolean);
    method public void sendUssd(String);
    method public void setListener(android.telephony.ims.ImsCallSessionListener);
    method public void setMute(boolean);
    method public void start(String, android.telephony.ims.ImsCallProfile);
    method public void startConference(String[], android.telephony.ims.ImsCallProfile);
    method public void startDtmf(char);
    method public void stopDtmf();
    method public void terminate(int);
    method public void update(int, android.telephony.ims.ImsStreamMediaProfile);
    field public static final int USSD_MODE_NOTIFY = 0; // 0x0
    field public static final int USSD_MODE_REQUEST = 1; // 0x1
  }

  public static class ImsCallSessionImplBase.State {
    method public static String toString(int);
    field public static final int ESTABLISHED = 4; // 0x4
    field public static final int ESTABLISHING = 3; // 0x3
    field public static final int IDLE = 0; // 0x0
    field public static final int INITIATED = 1; // 0x1
    field public static final int INVALID = -1; // 0xffffffff
    field public static final int NEGOTIATING = 2; // 0x2
    field public static final int REESTABLISHING = 6; // 0x6
    field public static final int RENEGOTIATING = 5; // 0x5
    field public static final int TERMINATED = 8; // 0x8
    field public static final int TERMINATING = 7; // 0x7
  }

  public class ImsConfigImplBase {
    ctor public ImsConfigImplBase();
    method public int getConfigInt(int);
    method public String getConfigString(int);
    method public final void notifyProvisionedValueChanged(int, int);
    method public final void notifyProvisionedValueChanged(int, String);
    method public int setConfig(int, int);
    method public int setConfig(int, String);
    field public static final int CONFIG_RESULT_FAILED = 1; // 0x1
    field public static final int CONFIG_RESULT_SUCCESS = 0; // 0x0
    field public static final int CONFIG_RESULT_UNKNOWN = -1; // 0xffffffff
  }

  public class ImsEcbmImplBase {
    ctor public ImsEcbmImplBase();
    method public final void enteredEcbm();
    method public void exitEmergencyCallbackMode();
    method public final void exitedEcbm();
  }

  public final class ImsFeatureConfiguration implements android.os.Parcelable {
    method public int describeContents();
    method public java.util.Set<android.telephony.ims.stub.ImsFeatureConfiguration.FeatureSlotPair> getServiceFeatures();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.ims.stub.ImsFeatureConfiguration> CREATOR;
  }

  public static class ImsFeatureConfiguration.Builder {
    ctor public ImsFeatureConfiguration.Builder();
    method public android.telephony.ims.stub.ImsFeatureConfiguration.Builder addFeature(int, int);
    method public android.telephony.ims.stub.ImsFeatureConfiguration build();
  }

  public static final class ImsFeatureConfiguration.FeatureSlotPair {
    ctor public ImsFeatureConfiguration.FeatureSlotPair(int, int);
    field public final int featureType;
    field public final int slotId;
  }

  public class ImsMultiEndpointImplBase {
    ctor public ImsMultiEndpointImplBase();
    method public final void onImsExternalCallStateUpdate(java.util.List<android.telephony.ims.ImsExternalCallState>);
    method public void requestImsExternalCallStateInfo();
  }

  public class ImsRegistrationImplBase {
    ctor public ImsRegistrationImplBase();
    method public final void onDeregistered(android.telephony.ims.ImsReasonInfo);
    method public final void onRegistered(int);
    method public final void onRegistering(int);
    method public final void onSubscriberAssociatedUriChanged(android.net.Uri[]);
    method public final void onTechnologyChangeFailed(int, android.telephony.ims.ImsReasonInfo);
    field public static final int REGISTRATION_TECH_IWLAN = 1; // 0x1
    field public static final int REGISTRATION_TECH_LTE = 0; // 0x0
    field public static final int REGISTRATION_TECH_NONE = -1; // 0xffffffff
  }

  public class ImsSmsImplBase {
    ctor public ImsSmsImplBase();
    method public void acknowledgeSms(int, int, int);
    method public void acknowledgeSmsReport(int, int, int);
    method public String getSmsFormat();
    method public void onReady();
    method public final void onSendSmsResult(int, int, int, int) throws java.lang.RuntimeException;
    method public final void onSmsReceived(int, String, byte[]) throws java.lang.RuntimeException;
    method public final void onSmsStatusReportReceived(int, int, String, byte[]) throws java.lang.RuntimeException;
    method public void sendSms(int, int, String, String, boolean, byte[]);
    field public static final int DELIVER_STATUS_ERROR_GENERIC = 2; // 0x2
    field public static final int DELIVER_STATUS_ERROR_NO_MEMORY = 3; // 0x3
    field public static final int DELIVER_STATUS_ERROR_REQUEST_NOT_SUPPORTED = 4; // 0x4
    field public static final int DELIVER_STATUS_OK = 1; // 0x1
    field public static final int SEND_STATUS_ERROR = 2; // 0x2
    field public static final int SEND_STATUS_ERROR_FALLBACK = 4; // 0x4
    field public static final int SEND_STATUS_ERROR_RETRY = 3; // 0x3
    field public static final int SEND_STATUS_OK = 1; // 0x1
    field public static final int STATUS_REPORT_STATUS_ERROR = 2; // 0x2
    field public static final int STATUS_REPORT_STATUS_OK = 1; // 0x1
  }

  public class ImsUtImplBase {
    ctor public ImsUtImplBase();
    method public void close();
    method public int queryCallBarring(int);
    method public int queryCallBarringForServiceClass(int, int);
    method public int queryCallForward(int, String);
    method public int queryCallWaiting();
    method public int queryClip();
    method public int queryClir();
    method public int queryColp();
    method public int queryColr();
    method public void setListener(android.telephony.ims.ImsUtListener);
    method public int transact(android.os.Bundle);
    method public int updateCallBarring(int, int, String[]);
    method public int updateCallBarringForServiceClass(int, int, String[], int);
    method public int updateCallForward(int, int, String, int, int);
    method public int updateCallWaiting(boolean, int);
    method public int updateClip(boolean);
    method public int updateClir(int);
    method public int updateColp(boolean);
    method public int updateColr(int);
  }

}

package android.telephony.mbms {

  public static class DownloadRequest.Builder {
    method public android.telephony.mbms.DownloadRequest.Builder setServiceId(String);
  }

  public final class FileInfo implements android.os.Parcelable {
    ctor public FileInfo(android.net.Uri, String);
  }

  public final class FileServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
    ctor public FileServiceInfo(java.util.Map<java.util.Locale,java.lang.String>, String, java.util.List<java.util.Locale>, String, java.util.Date, java.util.Date, java.util.List<android.telephony.mbms.FileInfo>);
  }

  public class MbmsDownloadReceiver extends android.content.BroadcastReceiver {
    field public static final int RESULT_APP_NOTIFICATION_ERROR = 6; // 0x6
    field public static final int RESULT_BAD_TEMP_FILE_ROOT = 3; // 0x3
    field public static final int RESULT_DOWNLOAD_FINALIZATION_ERROR = 4; // 0x4
    field public static final int RESULT_INVALID_ACTION = 1; // 0x1
    field public static final int RESULT_MALFORMED_INTENT = 2; // 0x2
    field public static final int RESULT_OK = 0; // 0x0
    field public static final int RESULT_TEMP_FILE_GENERATION_ERROR = 5; // 0x5
  }

  public final class StreamingServiceInfo extends android.telephony.mbms.ServiceInfo implements android.os.Parcelable {
    ctor public StreamingServiceInfo(java.util.Map<java.util.Locale,java.lang.String>, String, java.util.List<java.util.Locale>, String, java.util.Date, java.util.Date);
  }

  public final class UriPathPair implements android.os.Parcelable {
    method public int describeContents();
    method public android.net.Uri getContentUri();
    method public android.net.Uri getFilePathUri();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.telephony.mbms.UriPathPair> CREATOR;
  }

}

package android.telephony.mbms.vendor {

  public class MbmsDownloadServiceBase extends android.os.Binder {
    ctor public MbmsDownloadServiceBase();
    method public int addProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException;
    method public int addStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
    method public android.os.IBinder asBinder();
    method public int cancelDownload(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
    method public void dispose(int) throws android.os.RemoteException;
    method public int download(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
    method public static String getDefaultTransactionName(int);
    method public String getTransactionName(int);
    method public int initialize(int, android.telephony.mbms.MbmsDownloadSessionCallback) throws android.os.RemoteException;
    method @NonNull public java.util.List<android.telephony.mbms.DownloadRequest> listPendingDownloads(int) throws android.os.RemoteException;
    method public void onAppCallbackDied(int, int);
    method public boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
    method public int removeProgressListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadProgressListener) throws android.os.RemoteException;
    method public int removeStatusListener(android.telephony.mbms.DownloadRequest, android.telephony.mbms.DownloadStatusListener) throws android.os.RemoteException;
    method public int requestDownloadState(android.telephony.mbms.DownloadRequest, android.telephony.mbms.FileInfo) throws android.os.RemoteException;
    method public int requestUpdateFileServices(int, java.util.List<java.lang.String>) throws android.os.RemoteException;
    method public int resetDownloadKnowledge(android.telephony.mbms.DownloadRequest) throws android.os.RemoteException;
    method public int setTempFileRootDirectory(int, String) throws android.os.RemoteException;
  }

  public class MbmsGroupCallServiceBase extends android.app.Service {
    ctor public MbmsGroupCallServiceBase();
    method public void dispose(int) throws android.os.RemoteException;
    method public int initialize(@NonNull android.telephony.mbms.MbmsGroupCallSessionCallback, int) throws android.os.RemoteException;
    method public void onAppCallbackDied(int, int);
    method public android.os.IBinder onBind(android.content.Intent);
    method public int startGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, @NonNull android.telephony.mbms.GroupCallCallback);
    method public void stopGroupCall(int, long);
    method public void updateGroupCall(int, long, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>);
  }

  public class MbmsStreamingServiceBase extends android.os.Binder {
    ctor public MbmsStreamingServiceBase();
    method public android.os.IBinder asBinder();
    method public void dispose(int) throws android.os.RemoteException;
    method public static String getDefaultTransactionName(int);
    method @Nullable public android.net.Uri getPlaybackUri(int, String) throws android.os.RemoteException;
    method public String getTransactionName(int);
    method public int initialize(android.telephony.mbms.MbmsStreamingSessionCallback, int) throws android.os.RemoteException;
    method public void onAppCallbackDied(int, int);
    method public boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
    method public int requestUpdateStreamingServices(int, java.util.List<java.lang.String>) throws android.os.RemoteException;
    method public int startStreaming(int, String, android.telephony.mbms.StreamingServiceCallback) throws android.os.RemoteException;
    method public void stopStreaming(int, String) throws android.os.RemoteException;
  }

  public class VendorUtils {
    ctor public VendorUtils();
    method public static android.content.ComponentName getAppReceiverFromPackageName(android.content.Context, String);
    field public static final String ACTION_CLEANUP = "android.telephony.mbms.action.CLEANUP";
    field public static final String ACTION_DOWNLOAD_RESULT_INTERNAL = "android.telephony.mbms.action.DOWNLOAD_RESULT_INTERNAL";
    field public static final String ACTION_FILE_DESCRIPTOR_REQUEST = "android.telephony.mbms.action.FILE_DESCRIPTOR_REQUEST";
    field public static final String EXTRA_FD_COUNT = "android.telephony.mbms.extra.FD_COUNT";
    field public static final String EXTRA_FINAL_URI = "android.telephony.mbms.extra.FINAL_URI";
    field public static final String EXTRA_FREE_URI_LIST = "android.telephony.mbms.extra.FREE_URI_LIST";
    field public static final String EXTRA_PAUSED_LIST = "android.telephony.mbms.extra.PAUSED_LIST";
    field public static final String EXTRA_PAUSED_URI_LIST = "android.telephony.mbms.extra.PAUSED_URI_LIST";
    field public static final String EXTRA_SERVICE_ID = "android.telephony.mbms.extra.SERVICE_ID";
    field public static final String EXTRA_TEMP_FILES_IN_USE = "android.telephony.mbms.extra.TEMP_FILES_IN_USE";
    field public static final String EXTRA_TEMP_FILE_ROOT = "android.telephony.mbms.extra.TEMP_FILE_ROOT";
    field public static final String EXTRA_TEMP_LIST = "android.telephony.mbms.extra.TEMP_LIST";
  }

}

package android.util {

  public class EventLog {
    method public static void readEventsOnWrapping(int[], long, java.util.Collection<android.util.EventLog.Event>) throws java.io.IOException;
  }

  public static final class EventLog.Event {
    method public int getUid();
  }

}

package android.view {

  public interface WindowManager extends android.view.ViewManager {
    method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public android.graphics.Region getCurrentImeTouchRegion();
  }

  public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable {
    method public final long getUserActivityTimeout();
    method public final void setUserActivityTimeout(long);
  }

}

package android.webkit {

  public abstract class CookieManager {
    method protected abstract boolean allowFileSchemeCookiesImpl();
    method public abstract String getCookie(String, boolean);
    method public String getCookie(android.net.WebAddress);
    method public abstract boolean hasCookies(boolean);
    method protected abstract void setAcceptFileSchemeCookiesImpl(boolean);
  }

  public class FindActionModeCallback implements android.view.ActionMode.Callback android.text.TextWatcher android.view.View.OnClickListener android.webkit.WebView.FindListener {
    ctor public FindActionModeCallback(android.content.Context);
    method public void afterTextChanged(android.text.Editable);
    method public void beforeTextChanged(CharSequence, int, int, int);
    method public void findAll();
    method public void finish();
    method public int getActionModeGlobalBottom();
    method public boolean onActionItemClicked(android.view.ActionMode, android.view.MenuItem);
    method public void onClick(android.view.View);
    method public boolean onCreateActionMode(android.view.ActionMode, android.view.Menu);
    method public void onDestroyActionMode(android.view.ActionMode);
    method public void onFindResultReceived(int, int, boolean);
    method public boolean onPrepareActionMode(android.view.ActionMode, android.view.Menu);
    method public void onTextChanged(CharSequence, int, int, int);
    method public void setText(String);
    method public void setWebView(@NonNull android.webkit.WebView);
    method public void showSoftInput();
    method public void updateMatchCount(int, int, boolean);
  }

  public static class FindActionModeCallback.NoAction implements android.view.ActionMode.Callback {
    ctor public FindActionModeCallback.NoAction();
    method public boolean onActionItemClicked(android.view.ActionMode, android.view.MenuItem);
    method public boolean onCreateActionMode(android.view.ActionMode, android.view.Menu);
    method public void onDestroyActionMode(android.view.ActionMode);
    method public boolean onPrepareActionMode(android.view.ActionMode, android.view.Menu);
  }

  public class GeolocationPermissions {
    ctor public GeolocationPermissions();
  }

  public class HttpAuthHandler extends android.os.Handler {
    ctor public HttpAuthHandler();
  }

  public class JsDialogHelper {
    ctor public JsDialogHelper(android.webkit.JsPromptResult, int, String, String, String);
    ctor public JsDialogHelper(android.webkit.JsPromptResult, android.os.Message);
    method public boolean invokeCallback(android.webkit.WebChromeClient, android.webkit.WebView);
    method public void showDialog(android.content.Context);
    field public static final int ALERT = 1; // 0x1
    field public static final int CONFIRM = 2; // 0x2
    field public static final int PROMPT = 3; // 0x3
    field public static final int UNLOAD = 4; // 0x4
  }

  public class JsPromptResult extends android.webkit.JsResult {
    ctor public JsPromptResult(android.webkit.JsResult.ResultReceiver);
    method public String getStringResult();
  }

  public class JsResult {
    ctor public JsResult(android.webkit.JsResult.ResultReceiver);
    method public final boolean getResult();
  }

  public static interface JsResult.ResultReceiver {
    method public void onJsResultComplete(android.webkit.JsResult);
  }

  public class SslErrorHandler extends android.os.Handler {
    ctor public SslErrorHandler();
  }

  public abstract class TokenBindingService {
    ctor public TokenBindingService();
    method public abstract void deleteAllKeys(@Nullable android.webkit.ValueCallback<java.lang.Boolean>);
    method public abstract void deleteKey(android.net.Uri, @Nullable android.webkit.ValueCallback<java.lang.Boolean>);
    method public abstract void enableTokenBinding();
    method public static android.webkit.TokenBindingService getInstance();
    method public abstract void getKey(android.net.Uri, @Nullable String[], @NonNull android.webkit.ValueCallback<android.webkit.TokenBindingService.TokenBindingKey>);
    field public static final String KEY_ALGORITHM_ECDSAP256 = "ECDSAP256";
    field public static final String KEY_ALGORITHM_RSA2048_PKCS_1_5 = "RSA2048_PKCS_1.5";
    field public static final String KEY_ALGORITHM_RSA2048_PSS = "RSA2048PSS";
  }

  public abstract static class TokenBindingService.TokenBindingKey {
    ctor public TokenBindingService.TokenBindingKey();
    method public abstract String getAlgorithm();
    method public abstract java.security.KeyPair getKeyPair();
  }

  public class WebChromeClient {
    method @Deprecated public void openFileChooser(android.webkit.ValueCallback<android.net.Uri>, String, String);
  }

  public abstract class WebHistoryItem implements java.lang.Cloneable {
    method @Deprecated public abstract int getId();
  }

  @Deprecated public abstract class WebIconDatabase {
    method @Deprecated public abstract void bulkRequestIconForPageUrl(android.content.ContentResolver, String, android.webkit.WebIconDatabase.IconListener);
  }

  public abstract class WebMessagePort {
    ctor public WebMessagePort();
  }

  public abstract class WebResourceError {
    ctor public WebResourceError();
  }

  public class WebResourceResponse {
    ctor public WebResourceResponse(boolean, String, String, int, String, java.util.Map<java.lang.String,java.lang.String>, java.io.InputStream);
  }

  public abstract class WebSettings {
    method public abstract boolean getAcceptThirdPartyCookies();
    method @Deprecated public abstract boolean getNavDump();
    method @Deprecated public abstract boolean getPluginsEnabled();
    method @Deprecated public abstract boolean getUseWebViewBackgroundForOverscrollBackground();
    method @Deprecated public abstract int getUserAgent();
    method public abstract boolean getVideoOverlayForEmbeddedEncryptedVideoEnabled();
    method public abstract void setAcceptThirdPartyCookies(boolean);
    method @Deprecated public abstract void setNavDump(boolean);
    method @Deprecated public abstract void setPluginsEnabled(boolean);
    method @Deprecated public abstract void setUseWebViewBackgroundForOverscrollBackground(boolean);
    method @Deprecated public abstract void setUserAgent(int);
    method public abstract void setVideoOverlayForEmbeddedEncryptedVideoEnabled(boolean);
  }

  public class WebStorage {
    ctor public WebStorage();
  }

  public static class WebStorage.Origin {
    ctor protected WebStorage.Origin(String, long, long);
  }

  public class WebView extends android.widget.AbsoluteLayout implements android.view.ViewGroup.OnHierarchyChangeListener android.view.ViewTreeObserver.OnGlobalFocusChangeListener {
    method public android.webkit.WebViewProvider getWebViewProvider();
  }

  public static class WebView.HitTestResult {
    ctor public WebView.HitTestResult();
    method public void setExtra(String);
    method public void setType(int);
  }

  public class WebView.PrivateAccess {
    ctor public WebView.PrivateAccess();
    method public void awakenScrollBars(int);
    method public void awakenScrollBars(int, boolean);
    method public float getHorizontalScrollFactor();
    method public int getHorizontalScrollbarHeight();
    method public float getVerticalScrollFactor();
    method public void onScrollChanged(int, int, int, int);
    method public void overScrollBy(int, int, int, int, int, int, int, int, boolean);
    method public void setMeasuredDimension(int, int);
    method public void setScrollXRaw(int);
    method public void setScrollYRaw(int);
    method public void super_computeScroll();
    method public boolean super_dispatchKeyEvent(android.view.KeyEvent);
    method public int super_getScrollBarStyle();
    method public void super_onDrawVerticalScrollBar(android.graphics.Canvas, android.graphics.drawable.Drawable, int, int, int, int);
    method public boolean super_onGenericMotionEvent(android.view.MotionEvent);
    method public boolean super_onHoverEvent(android.view.MotionEvent);
    method public boolean super_performAccessibilityAction(int, android.os.Bundle);
    method public boolean super_performLongClick();
    method public boolean super_requestFocus(int, android.graphics.Rect);
    method public void super_scrollTo(int, int);
    method public boolean super_setFrame(int, int, int, int);
    method public void super_setLayoutParams(android.view.ViewGroup.LayoutParams);
    method public void super_startActivityForResult(android.content.Intent, int);
  }

  public final class WebViewDelegate {
    method public void addWebViewAssetPath(android.content.Context);
    method public void callDrawGlFunction(android.graphics.Canvas, long);
    method public void callDrawGlFunction(@NonNull android.graphics.Canvas, long, @Nullable Runnable);
    method public boolean canInvokeDrawGlFunctor(android.view.View);
    method public void detachDrawGlFunctor(android.view.View, long);
    method public android.app.Application getApplication();
    method public String getDataDirectorySuffix();
    method public String getErrorString(android.content.Context, int);
    method public int getPackageId(android.content.res.Resources, String);
    method public void invokeDrawGlFunctor(android.view.View, long, boolean);
    method public boolean isMultiProcessEnabled();
    method public boolean isTraceTagEnabled();
    method public void setOnTraceEnabledChangeListener(android.webkit.WebViewDelegate.OnTraceEnabledChangeListener);
  }

  public static interface WebViewDelegate.OnTraceEnabledChangeListener {
    method public void onTraceEnabledChange(boolean);
  }

  public final class WebViewFactory {
    ctor public WebViewFactory();
    method public static android.content.pm.PackageInfo getLoadedPackageInfo();
    method public static int loadWebViewNativeLibraryFromPackage(String, ClassLoader);
    method public static void prepareWebViewInZygote();
    field public static final String CHROMIUM_WEBVIEW_VMSIZE_SIZE_PROPERTY = "persist.sys.webview.vmsize";
    field public static final int LIBLOAD_ADDRESS_SPACE_NOT_RESERVED = 2; // 0x2
    field public static final int LIBLOAD_FAILED_JNI_CALL = 7; // 0x7
    field public static final int LIBLOAD_FAILED_LISTING_WEBVIEW_PACKAGES = 4; // 0x4
    field public static final int LIBLOAD_FAILED_TO_FIND_NAMESPACE = 10; // 0xa
    field public static final int LIBLOAD_FAILED_TO_LOAD_LIBRARY = 6; // 0x6
    field public static final int LIBLOAD_FAILED_TO_OPEN_RELRO_FILE = 5; // 0x5
    field public static final int LIBLOAD_FAILED_WAITING_FOR_RELRO = 3; // 0x3
    field public static final int LIBLOAD_FAILED_WAITING_FOR_WEBVIEW_REASON_UNKNOWN = 8; // 0x8
    field public static final int LIBLOAD_SUCCESS = 0; // 0x0
    field public static final int LIBLOAD_WRONG_PACKAGE_NAME = 1; // 0x1
  }

  public interface WebViewFactoryProvider {
    method public android.webkit.WebViewProvider createWebView(android.webkit.WebView, android.webkit.WebView.PrivateAccess);
    method public android.webkit.CookieManager getCookieManager();
    method public android.webkit.GeolocationPermissions getGeolocationPermissions();
    method public android.webkit.ServiceWorkerController getServiceWorkerController();
    method public android.webkit.WebViewFactoryProvider.Statics getStatics();
    method public android.webkit.TokenBindingService getTokenBindingService();
    method public android.webkit.TracingController getTracingController();
    method public android.webkit.WebIconDatabase getWebIconDatabase();
    method public android.webkit.WebStorage getWebStorage();
    method public ClassLoader getWebViewClassLoader();
    method public android.webkit.WebViewDatabase getWebViewDatabase(android.content.Context);
  }

  public static interface WebViewFactoryProvider.Statics {
    method public void clearClientCertPreferences(Runnable);
    method public void enableSlowWholeDocumentDraw();
    method public String findAddress(String);
    method public void freeMemoryForTests();
    method public String getDefaultUserAgent(android.content.Context);
    method @NonNull public android.net.Uri getSafeBrowsingPrivacyPolicyUrl();
    method public void initSafeBrowsing(android.content.Context, android.webkit.ValueCallback<java.lang.Boolean>);
    method public android.net.Uri[] parseFileChooserResult(int, android.content.Intent);
    method public void setSafeBrowsingWhitelist(java.util.List<java.lang.String>, android.webkit.ValueCallback<java.lang.Boolean>);
    method public void setWebContentsDebuggingEnabled(boolean);
  }

  public interface WebViewProvider {
    method public void addJavascriptInterface(Object, String);
    method public boolean canGoBack();
    method public boolean canGoBackOrForward(int);
    method public boolean canGoForward();
    method public boolean canZoomIn();
    method public boolean canZoomOut();
    method public android.graphics.Picture capturePicture();
    method public void clearCache(boolean);
    method public void clearFormData();
    method public void clearHistory();
    method public void clearMatches();
    method public void clearSslPreferences();
    method public void clearView();
    method public android.webkit.WebBackForwardList copyBackForwardList();
    method public android.print.PrintDocumentAdapter createPrintDocumentAdapter(String);
    method public android.webkit.WebMessagePort[] createWebMessageChannel();
    method public void destroy();
    method public void documentHasImages(android.os.Message);
    method public void dumpViewHierarchyWithProperties(java.io.BufferedWriter, int);
    method public void evaluateJavaScript(String, android.webkit.ValueCallback<java.lang.String>);
    method public int findAll(String);
    method public void findAllAsync(String);
    method public android.view.View findHierarchyView(String, int);
    method public void findNext(boolean);
    method public void flingScroll(int, int);
    method public void freeMemory();
    method public android.net.http.SslCertificate getCertificate();
    method public int getContentHeight();
    method public int getContentWidth();
    method public android.graphics.Bitmap getFavicon();
    method public android.webkit.WebView.HitTestResult getHitTestResult();
    method public String[] getHttpAuthUsernamePassword(String, String);
    method public String getOriginalUrl();
    method public int getProgress();
    method public boolean getRendererPriorityWaivedWhenNotVisible();
    method public int getRendererRequestedPriority();
    method public float getScale();
    method public android.webkit.WebViewProvider.ScrollDelegate getScrollDelegate();
    method public android.webkit.WebSettings getSettings();
    method @NonNull public default android.view.textclassifier.TextClassifier getTextClassifier();
    method public String getTitle();
    method public String getTouchIconUrl();
    method public String getUrl();
    method public android.webkit.WebViewProvider.ViewDelegate getViewDelegate();
    method public int getVisibleTitleHeight();
    method public android.webkit.WebChromeClient getWebChromeClient();
    method public android.webkit.WebViewClient getWebViewClient();
    method public android.view.View getZoomControls();
    method public void goBack();
    method public void goBackOrForward(int);
    method public void goForward();
    method public void init(java.util.Map<java.lang.String,java.lang.Object>, boolean);
    method public void insertVisualStateCallback(long, android.webkit.WebView.VisualStateCallback);
    method public void invokeZoomPicker();
    method public boolean isPaused();
    method public boolean isPrivateBrowsingEnabled();
    method public void loadData(String, String, String);
    method public void loadDataWithBaseURL(String, String, String, String, String);
    method public void loadUrl(String, java.util.Map<java.lang.String,java.lang.String>);
    method public void loadUrl(String);
    method public void notifyFindDialogDismissed();
    method public void onPause();
    method public void onResume();
    method public boolean overlayHorizontalScrollbar();
    method public boolean overlayVerticalScrollbar();
    method public boolean pageDown(boolean);
    method public boolean pageUp(boolean);
    method public void pauseTimers();
    method public void postMessageToMainFrame(android.webkit.WebMessage, android.net.Uri);
    method public void postUrl(String, byte[]);
    method public void reload();
    method public void removeJavascriptInterface(String);
    method public void requestFocusNodeHref(android.os.Message);
    method public void requestImageRef(android.os.Message);
    method public boolean restorePicture(android.os.Bundle, java.io.File);
    method public android.webkit.WebBackForwardList restoreState(android.os.Bundle);
    method public void resumeTimers();
    method public void savePassword(String, String, String);
    method public boolean savePicture(android.os.Bundle, java.io.File);
    method public android.webkit.WebBackForwardList saveState(android.os.Bundle);
    method public void saveWebArchive(String);
    method public void saveWebArchive(String, boolean, android.webkit.ValueCallback<java.lang.String>);
    method public void setCertificate(android.net.http.SslCertificate);
    method public void setDownloadListener(android.webkit.DownloadListener);
    method public void setFindListener(android.webkit.WebView.FindListener);
    method public void setHorizontalScrollbarOverlay(boolean);
    method public void setHttpAuthUsernamePassword(String, String, String, String);
    method public void setInitialScale(int);
    method public void setMapTrackballToArrowKeys(boolean);
    method public void setNetworkAvailable(boolean);
    method public void setPictureListener(android.webkit.WebView.PictureListener);
    method public void setRendererPriorityPolicy(int, boolean);
    method public default void setTextClassifier(@Nullable android.view.textclassifier.TextClassifier);
    method public void setVerticalScrollbarOverlay(boolean);
    method public void setWebChromeClient(android.webkit.WebChromeClient);
    method public void setWebViewClient(android.webkit.WebViewClient);
    method public boolean showFindDialog(String, boolean);
    method public void stopLoading();
    method public boolean zoomBy(float);
    method public boolean zoomIn();
    method public boolean zoomOut();
  }

  public static interface WebViewProvider.ScrollDelegate {
    method public int computeHorizontalScrollOffset();
    method public int computeHorizontalScrollRange();
    method public void computeScroll();
    method public int computeVerticalScrollExtent();
    method public int computeVerticalScrollOffset();
    method public int computeVerticalScrollRange();
  }

  public static interface WebViewProvider.ViewDelegate {
    method public default void autofill(android.util.SparseArray<android.view.autofill.AutofillValue>);
    method public boolean dispatchKeyEvent(android.view.KeyEvent);
    method public android.view.View findFocus(android.view.View);
    method public android.view.accessibility.AccessibilityNodeProvider getAccessibilityNodeProvider();
    method public android.os.Handler getHandler(android.os.Handler);
    method public default boolean isVisibleToUserForAutofill(int);
    method public void onActivityResult(int, int, android.content.Intent);
    method public void onAttachedToWindow();
    method public default boolean onCheckIsTextEditor();
    method public void onConfigurationChanged(android.content.res.Configuration);
    method public android.view.inputmethod.InputConnection onCreateInputConnection(android.view.inputmethod.EditorInfo);
    method public void onDetachedFromWindow();
    method public boolean onDragEvent(android.view.DragEvent);
    method public void onDraw(android.graphics.Canvas);
    method public void onDrawVerticalScrollBar(android.graphics.Canvas, android.graphics.drawable.Drawable, int, int, int, int);
    method public void onFinishTemporaryDetach();
    method public void onFocusChanged(boolean, int, android.graphics.Rect);
    method public boolean onGenericMotionEvent(android.view.MotionEvent);
    method public boolean onHoverEvent(android.view.MotionEvent);
    method public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
    method public void onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo);
    method public boolean onKeyDown(int, android.view.KeyEvent);
    method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
    method public boolean onKeyUp(int, android.view.KeyEvent);
    method public void onMeasure(int, int);
    method public default void onMovedToDisplay(int, android.content.res.Configuration);
    method public void onOverScrolled(int, int, boolean, boolean);
    method public default void onProvideAutofillVirtualStructure(android.view.ViewStructure, int);
    method public void onProvideVirtualStructure(android.view.ViewStructure);
    method public void onScrollChanged(int, int, int, int);
    method public void onSizeChanged(int, int, int, int);
    method public void onStartTemporaryDetach();
    method public boolean onTouchEvent(android.view.MotionEvent);
    method public boolean onTrackballEvent(android.view.MotionEvent);
    method public void onVisibilityChanged(android.view.View, int);
    method public void onWindowFocusChanged(boolean);
    method public void onWindowVisibilityChanged(int);
    method public boolean performAccessibilityAction(int, android.os.Bundle);
    method public boolean performLongClick();
    method public void preDispatchDraw(android.graphics.Canvas);
    method public boolean requestChildRectangleOnScreen(android.view.View, android.graphics.Rect, boolean);
    method public boolean requestFocus(int, android.graphics.Rect);
    method public void setBackgroundColor(int);
    method public boolean setFrame(int, int, int, int);
    method public void setLayerType(int, android.graphics.Paint);
    method public void setLayoutParams(android.view.ViewGroup.LayoutParams);
    method public void setOverScrollMode(int);
    method public void setScrollBarStyle(int);
    method public boolean shouldDelayChildPressedState();
  }

  public final class WebViewProviderInfo implements android.os.Parcelable {
    ctor public WebViewProviderInfo(String, String, boolean, boolean, String[]);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.webkit.WebViewProviderInfo> CREATOR;
    field public final boolean availableByDefault;
    field public final String description;
    field public final boolean isFallback;
    field public final String packageName;
    field public final android.content.pm.Signature[] signatures;
  }

  public final class WebViewUpdateService {
    method public static android.webkit.WebViewProviderInfo[] getAllWebViewPackages();
    method public static String getCurrentWebViewPackageName();
    method public static android.webkit.WebViewProviderInfo[] getValidWebViewPackages();
  }

}

