// 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_CONTEXT_HUB = "android.permission.ACCESS_CONTEXT_HUB";
    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_INSTANT_APPS = "android.permission.ACCESS_INSTANT_APPS";
    field public static final String ACCESS_LOCUS_ID_USAGE_STATS = "android.permission.ACCESS_LOCUS_ID_USAGE_STATS";
    field public static final String ACCESS_MESSAGES_ON_ICC = "android.permission.ACCESS_MESSAGES_ON_ICC";
    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_SHARED_LIBRARIES = "android.permission.ACCESS_SHARED_LIBRARIES";
    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 ACCESS_TV_DESCRAMBLER = "android.permission.ACCESS_TV_DESCRAMBLER";
    field public static final String ACCESS_TV_TUNER = "android.permission.ACCESS_TV_TUNER";
    field public static final String ACCESS_VIBRATOR_STATE = "android.permission.ACCESS_VIBRATOR_STATE";
    field public static final String ACTIVITY_EMBEDDING = "android.permission.ACTIVITY_EMBEDDING";
    field public static final String ADJUST_RUNTIME_PERMISSIONS_POLICY = "android.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY";
    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 AMBIENT_WALLPAPER = "android.permission.AMBIENT_WALLPAPER";
    field public static final String APPROVE_INCIDENT_REPORTS = "android.permission.APPROVE_INCIDENT_REPORTS";
    field public static final String BACKUP = "android.permission.BACKUP";
    field public static final String BIND_ATTENTION_SERVICE = "android.permission.BIND_ATTENTION_SERVICE";
    field public static final String BIND_AUGMENTED_AUTOFILL_SERVICE = "android.permission.BIND_AUGMENTED_AUTOFILL_SERVICE";
    field public static final String BIND_CELL_BROADCAST_SERVICE = "android.permission.BIND_CELL_BROADCAST_SERVICE";
    field @Deprecated public static final String BIND_CONNECTION_SERVICE = "android.permission.BIND_CONNECTION_SERVICE";
    field public static final String BIND_CONTENT_CAPTURE_SERVICE = "android.permission.BIND_CONTENT_CAPTURE_SERVICE";
    field public static final String BIND_CONTENT_SUGGESTIONS_SERVICE = "android.permission.BIND_CONTENT_SUGGESTIONS_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_EXTERNAL_STORAGE_SERVICE = "android.permission.BIND_EXTERNAL_STORAGE_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_MEDIA_OUTPUT = "android.permission.CAPTURE_MEDIA_OUTPUT";
    field public static final String CAPTURE_TV_INPUT = "android.permission.CAPTURE_TV_INPUT";
    field public static final String CAPTURE_VOICE_COMMUNICATION_OUTPUT = "android.permission.CAPTURE_VOICE_COMMUNICATION_OUTPUT";
    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 COMPANION_APPROVE_WIFI_CONNECTIONS = "android.permission.COMPANION_APPROVE_WIFI_CONNECTIONS";
    field public static final String CONFIGURE_DISPLAY_BRIGHTNESS = "android.permission.CONFIGURE_DISPLAY_BRIGHTNESS";
    field public static final String CONFIGURE_WIFI_DISPLAY = "android.permission.CONFIGURE_WIFI_DISPLAY";
    field @Deprecated 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_DEVICE_LIGHTS = "android.permission.CONTROL_DEVICE_LIGHTS";
    field public static final String CONTROL_DISPLAY_COLOR_TRANSFORMS = "android.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS";
    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_KEYGUARD_SECURE_NOTIFICATIONS = "android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS";
    field public static final String CONTROL_VPN = "android.permission.CONTROL_VPN";
    field public static final String CREATE_USERS = "android.permission.CREATE_USERS";
    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 ENTER_CAR_MODE_PRIORITIZED = "android.permission.ENTER_CAR_MODE_PRIORITIZED";
    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_RUNTIME_PERMISSIONS = "android.permission.GET_RUNTIME_PERMISSIONS";
    field public static final String GET_TOP_ACTIVITY_INFO = "android.permission.GET_TOP_ACTIVITY_INFO";
    field @Deprecated public static final String GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS = "android.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS";
    field public static final String GRANT_RUNTIME_PERMISSIONS = "android.permission.GRANT_RUNTIME_PERMISSIONS";
    field public static final String GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS = "android.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS";
    field public static final String HANDLE_CAR_MODE_CHANGES = "android.permission.HANDLE_CAR_MODE_CHANGES";
    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_DYNAMIC_SYSTEM = "android.permission.INSTALL_DYNAMIC_SYSTEM";
    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 LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH = "android.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH";
    field public static final String LOCAL_MAC_ADDRESS = "android.permission.LOCAL_MAC_ADDRESS";
    field public static final String LOCK_DEVICE = "android.permission.LOCK_DEVICE";
    field public static final String LOOP_RADIO = "android.permission.LOOP_RADIO";
    field public static final String MANAGE_ACCESSIBILITY = "android.permission.MANAGE_ACCESSIBILITY";
    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_PREDICTIONS = "android.permission.MANAGE_APP_PREDICTIONS";
    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_CONTENT_CAPTURE = "android.permission.MANAGE_CONTENT_CAPTURE";
    field public static final String MANAGE_CONTENT_SUGGESTIONS = "android.permission.MANAGE_CONTENT_SUGGESTIONS";
    field public static final String MANAGE_DEBUGGING = "android.permission.MANAGE_DEBUGGING";
    field public static final String MANAGE_FACTORY_RESET_PROTECTION = "android.permission.MANAGE_FACTORY_RESET_PROTECTION";
    field public static final String MANAGE_IPSEC_TUNNELS = "android.permission.MANAGE_IPSEC_TUNNELS";
    field public static final String MANAGE_ONE_TIME_PERMISSION_SESSIONS = "android.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS";
    field public static final String MANAGE_ROLE_HOLDERS = "android.permission.MANAGE_ROLE_HOLDERS";
    field public static final String MANAGE_ROLLBACKS = "android.permission.MANAGE_ROLLBACKS";
    field public static final String MANAGE_SENSOR_PRIVACY = "android.permission.MANAGE_SENSOR_PRIVACY";
    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 MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE = "android.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE";
    field public static final String MOVE_PACKAGE = "android.permission.MOVE_PACKAGE";
    field public static final String NETWORK_AIRPLANE_MODE = "android.permission.NETWORK_AIRPLANE_MODE";
    field public static final String NETWORK_CARRIER_PROVISIONING = "android.permission.NETWORK_CARRIER_PROVISIONING";
    field public static final String NETWORK_FACTORY = "android.permission.NETWORK_FACTORY";
    field public static final String NETWORK_MANAGED_PROVISIONING = "android.permission.NETWORK_MANAGED_PROVISIONING";
    field public static final String NETWORK_SCAN = "android.permission.NETWORK_SCAN";
    field public static final String NETWORK_SETTINGS = "android.permission.NETWORK_SETTINGS";
    field public static final String NETWORK_SETUP_WIZARD = "android.permission.NETWORK_SETUP_WIZARD";
    field public static final String NETWORK_SIGNAL_STRENGTH_WAKEUP = "android.permission.NETWORK_SIGNAL_STRENGTH_WAKEUP";
    field public static final String NETWORK_STACK = "android.permission.NETWORK_STACK";
    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 OBSERVE_NETWORK_POLICY = "android.permission.OBSERVE_NETWORK_POLICY";
    field public static final String OBSERVE_ROLE_HOLDERS = "android.permission.OBSERVE_ROLE_HOLDERS";
    field public static final String OPEN_ACCESSIBILITY_DETAILS_SETTINGS = "android.permission.OPEN_ACCESSIBILITY_DETAILS_SETTINGS";
    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 POWER_SAVER = "android.permission.POWER_SAVER";
    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 RADIO_SCAN_WITHOUT_LOCATION = "android.permission.RADIO_SCAN_WITHOUT_LOCATION";
    field public static final String READ_ACTIVE_EMERGENCY_SESSION = "android.permission.READ_ACTIVE_EMERGENCY_SESSION";
    field public static final String READ_CARRIER_APP_INFO = "android.permission.READ_CARRIER_APP_INFO";
    field public static final String READ_CELL_BROADCASTS = "android.permission.READ_CELL_BROADCASTS";
    field public static final String READ_CONTENT_RATING_SYSTEMS = "android.permission.READ_CONTENT_RATING_SYSTEMS";
    field public static final String READ_DEVICE_CONFIG = "android.permission.READ_DEVICE_CONFIG";
    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_DEVICE_CUSTOMIZATION_READY = "android.permission.RECEIVE_DEVICE_CUSTOMIZATION_READY";
    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 REGISTER_STATS_PULL_ATOM = "android.permission.REGISTER_STATS_PULL_ATOM";
    field public static final String REMOTE_DISPLAY_PROVIDER = "android.permission.REMOTE_DISPLAY_PROVIDER";
    field public static final String REMOVE_DRM_CERTIFICATES = "android.permission.REMOVE_DRM_CERTIFICATES";
    field public static final String REMOVE_TASKS = "android.permission.REMOVE_TASKS";
    field public static final String REQUEST_NETWORK_SCORES = "android.permission.REQUEST_NETWORK_SCORES";
    field public static final String REQUEST_NOTIFICATION_ASSISTANT_SERVICE = "android.permission.REQUEST_NOTIFICATION_ASSISTANT_SERVICE";
    field public static final String RESET_PASSWORD = "android.permission.RESET_PASSWORD";
    field public static final String RESTORE_RUNTIME_PERMISSIONS = "android.permission.RESTORE_RUNTIME_PERMISSIONS";
    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 REVIEW_ACCESSIBILITY_SERVICES = "android.permission.REVIEW_ACCESSIBILITY_SERVICES";
    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 SECURE_ELEMENT_PRIVILEGED = "android.permission.SECURE_ELEMENT_PRIVILEGED";
    field public static final String SEND_DEVICE_CUSTOMIZATION_READY = "android.permission.SEND_DEVICE_CUSTOMIZATION_READY";
    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 SUBSTITUTE_SHARE_TARGET_APP_NAME_AND_ICON = "android.permission.SUBSTITUTE_SHARE_TARGET_APP_NAME_AND_ICON";
    field public static final String SUSPEND_APPS = "android.permission.SUSPEND_APPS";
    field public static final String SYSTEM_CAMERA = "android.permission.SYSTEM_CAMERA";
    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 WHITELIST_RESTRICTED_PERMISSIONS = "android.permission.WHITELIST_RESTRICTED_PERMISSIONS";
    field public static final String WIFI_SET_DEVICE_MOBILITY_STATE = "android.permission.WIFI_SET_DEVICE_MOBILITY_STATE";
    field public static final String WIFI_UPDATE_USABILITY_STATS_SCORE = "android.permission.WIFI_UPDATE_USABILITY_STATS_SCORE";
    field public static final String WRITE_DEVICE_CONFIG = "android.permission.WRITE_DEVICE_CONFIG";
    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 @Deprecated public static final String WRITE_MEDIA_STORAGE = "android.permission.WRITE_MEDIA_STORAGE";
    field public static final String WRITE_OBB = "android.permission.WRITE_OBB";
  }

  public static final class Manifest.permission_group {
    field public static final String UNDEFINED = "android.permission-group.UNDEFINED";
  }

  public static final class R.array {
    field public static final int config_keySystemUuidMapping = 17235973; // 0x1070005
    field public static final int config_restrictedPreinstalledCarrierApps = 17235975; // 0x1070007
    field public static final int config_sms_enabled_locking_shift_tables = 17235977; // 0x1070009
    field public static final int config_sms_enabled_single_shift_tables = 17235976; // 0x1070008
    field public static final int simColors = 17235974; // 0x1070006
  }

  public static final class R.attr {
    field public static final int allowClearUserDataOnFailedRestore = 16844288; // 0x1010600
    field public static final int isVrOnly = 16844152; // 0x1010578
    field public static final int minExtensionVersion = 16844306; // 0x1010612
    field public static final int requiredSystemPropertyName = 16844133; // 0x1010565
    field public static final int requiredSystemPropertyValue = 16844134; // 0x1010566
    field public static final int sdkVersion = 16844305; // 0x1010611
    field public static final int supportsAmbientMode = 16844173; // 0x101058d
    field public static final int userRestriction = 16844164; // 0x1010584
  }

  public static final class R.bool {
    field public static final int config_sendPackageName = 17891328; // 0x1110000
    field public static final int config_showDefaultAssistant = 17891329; // 0x1110001
    field public static final int config_showDefaultEmergency = 17891330; // 0x1110002
    field public static final int config_showDefaultHome = 17891331; // 0x1110003
  }

  public static final class R.color {
    field public static final int system_notification_accent_color = 17170460; // 0x106001c
  }

  public static final class R.dimen {
    field public static final int config_restrictedIconSize = 17104903; // 0x1050007
  }

  public static final class R.drawable {
    field public static final int ic_info = 17301684; // 0x10800b4
  }

  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.string {
    field public static final int config_defaultAssistant = 17039393; // 0x1040021
    field public static final int config_defaultBrowser = 17039394; // 0x1040022
    field public static final int config_defaultCallRedirection = 17039400; // 0x1040028
    field public static final int config_defaultCallScreening = 17039401; // 0x1040029
    field public static final int config_defaultDialer = 17039395; // 0x1040023
    field public static final int config_defaultSms = 17039396; // 0x1040024
    field public static final int config_feedbackIntentExtraKey = 17039391; // 0x104001f
    field public static final int config_feedbackIntentNameKey = 17039392; // 0x1040020
    field public static final int config_helpIntentExtraKey = 17039389; // 0x104001d
    field public static final int config_helpIntentNameKey = 17039390; // 0x104001e
    field public static final int config_helpPackageNameKey = 17039387; // 0x104001b
    field public static final int config_helpPackageNameValue = 17039388; // 0x104001c
    field public static final int config_systemGallery = 17039402; // 0x104002a
    field public static final int low_memory = 17039403; // 0x104002b
  }

  public static final class R.style {
    field public static final int Theme_DeviceDefault_DocumentsUI = 16974562; // 0x10302e2
    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 @NonNull public java.util.Collection<java.util.Locale> getSupportedLocales();
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getUidImportance(int);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isProfileForeground(@NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) public void killProcessesWhenImperceptible(@NonNull int[], @NonNull String);
    method @RequiresPermission(android.Manifest.permission.KILL_UID) public void killUid(int, String);
    method public void registerHomeVisibilityObserver(@NonNull android.app.HomeVisibilityObserver);
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void removeOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener);
    method public void setDeviceLocales(@NonNull android.os.LocaleList);
    method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public static void setPersistentVrThread(int);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean switchUser(@NonNull android.os.UserHandle);
    method public void unregisterHomeVisibilityObserver(@NonNull android.app.HomeVisibilityObserver);
    method @RequiresPermission(android.Manifest.permission.CHANGE_CONFIGURATION) public boolean updateMccMncConfiguration(@NonNull String, @NonNull String);
  }

  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 @Nullable @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public android.app.RuntimeAppOpAccessMessage collectRuntimeAppOpAccessMessage();
    method @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public void getHistoricalOps(@NonNull android.app.AppOpsManager.HistoricalOpsRequest, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.app.AppOpsManager.HistoricalOps>);
    method public static String[] getOpStrs();
    method @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List<android.app.AppOpsManager.PackageOps> getOpsForPackage(int, @NonNull String, @Nullable java.lang.String...);
    method @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List<android.app.AppOpsManager.PackageOps> getPackagesForOps(@Nullable String[]);
    method public static int opToDefaultMode(@NonNull String);
    method @Nullable public static String opToPermission(@NonNull String);
    method @RequiresPermission("android.permission.MANAGE_APP_OPS_MODES") public void setMode(@NonNull String, int, @Nullable String, int);
    method @RequiresPermission("android.permission.MANAGE_APP_OPS_MODES") public void setUidMode(@NonNull String, int, int);
    field public static final String OPSTR_ACCEPT_HANDOVER = "android:accept_handover";
    field public static final String OPSTR_ACCESS_ACCESSIBILITY = "android:access_accessibility";
    field public static final String OPSTR_ACCESS_CALL_AUDIO = "android:access_call_audio";
    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_INTERACT_ACROSS_PROFILES = "android:interact_across_profiles";
    field public static final String OPSTR_LEGACY_STORAGE = "android:legacy_storage";
    field public static final String OPSTR_LOADER_USAGE_STATS = "android:loader_usage_stats";
    field public static final String OPSTR_MANAGE_EXTERNAL_STORAGE = "android:manage_external_storage";
    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_DEVICE_IDENTIFIERS = "android:read_device_identifiers";
    field public static final String OPSTR_READ_ICC_SMS = "android:read_icc_sms";
    field public static final String OPSTR_READ_MEDIA_AUDIO = "android:read_media_audio";
    field public static final String OPSTR_READ_MEDIA_IMAGES = "android:read_media_images";
    field public static final String OPSTR_READ_MEDIA_VIDEO = "android:read_media_video";
    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_MEDIA_AUDIO = "android:write_media_audio";
    field public static final String OPSTR_WRITE_MEDIA_IMAGES = "android:write_media_images";
    field public static final String OPSTR_WRITE_MEDIA_VIDEO = "android:write_media_video";
    field public static final String OPSTR_WRITE_SMS = "android:write_sms";
    field public static final String OPSTR_WRITE_WALLPAPER = "android:write_wallpaper";
    field public static final int OP_FLAGS_ALL = 31; // 0x1f
    field public static final int OP_FLAGS_ALL_TRUSTED = 13; // 0xd
    field public static final int OP_FLAG_SELF = 1; // 0x1
    field public static final int OP_FLAG_TRUSTED_PROXIED = 8; // 0x8
    field public static final int OP_FLAG_TRUSTED_PROXY = 2; // 0x2
    field public static final int OP_FLAG_UNTRUSTED_PROXIED = 16; // 0x10
    field public static final int OP_FLAG_UNTRUSTED_PROXY = 4; // 0x4
    field public static final int UID_STATE_BACKGROUND = 600; // 0x258
    field public static final int UID_STATE_CACHED = 700; // 0x2bc
    field public static final int UID_STATE_FOREGROUND = 500; // 0x1f4
    field public static final int UID_STATE_FOREGROUND_SERVICE = 400; // 0x190
    field @Deprecated public static final int UID_STATE_FOREGROUND_SERVICE_LOCATION = 300; // 0x12c
    field public static final int UID_STATE_PERSISTENT = 100; // 0x64
    field public static final int UID_STATE_TOP = 200; // 0xc8
  }

  public static final class AppOpsManager.HistoricalFeatureOps implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getFeatureId();
    method @Nullable public android.app.AppOpsManager.HistoricalOp getOp(@NonNull String);
    method @NonNull public android.app.AppOpsManager.HistoricalOp getOpAt(@IntRange(from=0) int);
    method @IntRange(from=0) public int getOpCount();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.HistoricalFeatureOps> CREATOR;
  }

  public static final class AppOpsManager.HistoricalOp implements android.os.Parcelable {
    method public int describeContents();
    method public long getAccessCount(int, int, int);
    method public long getAccessDuration(int, int, int);
    method public long getBackgroundAccessCount(int);
    method public long getBackgroundAccessDuration(int);
    method public long getBackgroundRejectCount(int);
    method public long getForegroundAccessCount(int);
    method public long getForegroundAccessDuration(int);
    method public long getForegroundRejectCount(int);
    method @NonNull public String getOpName();
    method public long getRejectCount(int, int, int);
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.HistoricalOp> CREATOR;
  }

  public static final class AppOpsManager.HistoricalOps implements android.os.Parcelable {
    method public int describeContents();
    method public long getBeginTimeMillis();
    method public long getEndTimeMillis();
    method @IntRange(from=0) public int getUidCount();
    method @Nullable public android.app.AppOpsManager.HistoricalUidOps getUidOps(int);
    method @NonNull public android.app.AppOpsManager.HistoricalUidOps getUidOpsAt(@IntRange(from=0) int);
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.HistoricalOps> CREATOR;
  }

  public static final class AppOpsManager.HistoricalOpsRequest {
  }

  public static final class AppOpsManager.HistoricalOpsRequest.Builder {
    ctor public AppOpsManager.HistoricalOpsRequest.Builder(long, long);
    method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest build();
    method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest.Builder setFeatureId(@Nullable String);
    method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest.Builder setFlags(int);
    method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest.Builder setOpNames(@Nullable java.util.List<java.lang.String>);
    method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest.Builder setPackageName(@Nullable String);
    method @NonNull public android.app.AppOpsManager.HistoricalOpsRequest.Builder setUid(int);
  }

  public static final class AppOpsManager.HistoricalPackageOps implements android.os.Parcelable {
    method public int describeContents();
    method @IntRange(from=0) public int getFeatureCount();
    method @Nullable public android.app.AppOpsManager.HistoricalFeatureOps getFeatureOps(@NonNull String);
    method @NonNull public android.app.AppOpsManager.HistoricalFeatureOps getFeatureOpsAt(@IntRange(from=0) int);
    method @Nullable public android.app.AppOpsManager.HistoricalOp getOp(@NonNull String);
    method @NonNull public android.app.AppOpsManager.HistoricalOp getOpAt(@IntRange(from=0) int);
    method @IntRange(from=0) public int getOpCount();
    method @NonNull public String getPackageName();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.HistoricalPackageOps> CREATOR;
  }

  public static final class AppOpsManager.HistoricalUidOps implements android.os.Parcelable {
    method public int describeContents();
    method @IntRange(from=0) public int getPackageCount();
    method @Nullable public android.app.AppOpsManager.HistoricalPackageOps getPackageOps(@NonNull String);
    method @NonNull public android.app.AppOpsManager.HistoricalPackageOps getPackageOpsAt(@IntRange(from=0) int);
    method public int getUid();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.HistoricalUidOps> CREATOR;
  }

  public static final class AppOpsManager.OpEntry implements android.os.Parcelable {
    method public int describeContents();
    method @Deprecated public long getDuration();
    method @NonNull public java.util.Map<java.lang.String,android.app.AppOpsManager.OpFeatureEntry> getFeatures();
    method public long getLastAccessBackgroundTime(int);
    method public long getLastAccessForegroundTime(int);
    method public long getLastAccessTime(int);
    method public long getLastAccessTime(int, int, int);
    method public long getLastBackgroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastBackgroundProxyInfo(int);
    method public long getLastDuration(int);
    method public long getLastDuration(int, int, int);
    method public long getLastForegroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastForegroundProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int, int, int);
    method public long getLastRejectBackgroundTime(int);
    method public long getLastRejectForegroundTime(int);
    method public long getLastRejectTime(int);
    method public long getLastRejectTime(int, int, int);
    method public int getMode();
    method @NonNull public String getOpStr();
    method @Deprecated @Nullable public String getProxyPackageName();
    method @Deprecated @Nullable public String getProxyPackageName(int, int);
    method @Deprecated public int getProxyUid();
    method @Deprecated public int getProxyUid(int, int);
    method public boolean isRunning();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpEntry> CREATOR;
  }

  public static final class AppOpsManager.OpEventProxyInfo implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getFeatureId();
    method @Nullable public String getPackageName();
    method @IntRange(from=0) public int getUid();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpEventProxyInfo> CREATOR;
  }

  public static final class AppOpsManager.OpFeatureEntry implements android.os.Parcelable {
    method public int describeContents();
    method public long getLastAccessBackgroundTime(int);
    method public long getLastAccessForegroundTime(int);
    method public long getLastAccessTime(int);
    method public long getLastAccessTime(int, int, int);
    method public long getLastBackgroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastBackgroundProxyInfo(int);
    method public long getLastDuration(int);
    method public long getLastDuration(int, int, int);
    method public long getLastForegroundDuration(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastForegroundProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int);
    method @Nullable public android.app.AppOpsManager.OpEventProxyInfo getLastProxyInfo(int, int, int);
    method public long getLastRejectBackgroundTime(int);
    method public long getLastRejectForegroundTime(int);
    method public long getLastRejectTime(int);
    method public long getLastRejectTime(int, int, int);
    method public boolean isRunning();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.OpFeatureEntry> CREATOR;
  }

  public static final class AppOpsManager.PackageOps implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.List<android.app.AppOpsManager.OpEntry> getOps();
    method @NonNull public String getPackageName();
    method public int getUid();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.AppOpsManager.PackageOps> CREATOR;
  }

  public class BroadcastOptions {
    method public static android.app.BroadcastOptions makeBasic();
    method @RequiresPermission("android.permission.START_ACTIVITIES_FROM_BACKGROUND") public void setBackgroundActivityStartsAllowed(boolean);
    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 {
    method @RequiresPermission(android.Manifest.permission.WRITE_MEDIA_STORAGE) public void onMediaStoreDownloadsDeleted(@NonNull android.util.LongSparseArray<java.lang.String>);
    field public static final String ACTION_DOWNLOAD_COMPLETED = "android.intent.action.DOWNLOAD_COMPLETED";
  }

  public abstract class HomeVisibilityObserver {
    ctor public HomeVisibilityObserver();
    method public abstract void onHomeVisibilityChanged(boolean);
  }

  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(@Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
    method @Deprecated public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
    method @Deprecated public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
    method public void onGetInstantAppIntentFilter(@NonNull android.content.pm.InstantAppRequestInfo, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
    method @Deprecated public void onGetInstantAppResolveInfo(@Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
    method @Deprecated public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
    method @Deprecated public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @NonNull android.app.InstantAppResolverService.InstantAppResolutionCallback);
    method public void onGetInstantAppResolveInfo(@NonNull android.content.pm.InstantAppRequestInfo, @NonNull 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.permission.SET_INITIAL_LOCK") public int getMinLockLength(boolean, int);
    method @RequiresPermission(android.Manifest.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS) public boolean getPrivateNotificationsAllowed();
    method @RequiresPermission(android.Manifest.permission.SHOW_KEYGUARD_MESSAGE) public void requestDismissKeyguard(@NonNull android.app.Activity, @Nullable CharSequence, @Nullable android.app.KeyguardManager.KeyguardDismissCallback);
    method @RequiresPermission("android.permission.SET_INITIAL_LOCK") public boolean setLock(int, @NonNull byte[], int);
    method @RequiresPermission(android.Manifest.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS) public void setPrivateNotificationsAllowed(boolean);
    method @RequiresPermission("android.permission.SET_INITIAL_LOCK") public boolean validateLockPasswordComplexity(boolean, @NonNull byte[], int);
  }

  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 void setBlockableSystem(boolean);
    method public org.json.JSONObject toJson() throws org.json.JSONException;
    method public void writeXml(org.xmlpull.v1.XmlSerializer) throws java.io.IOException;
    field public static final int USER_LOCKED_SOUND = 32; // 0x20
  }

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

  public class NotificationManager {
    method @NonNull public java.util.List<java.lang.String> getAllowedAssistantAdjustments();
    method @Nullable public android.content.ComponentName getAllowedNotificationAssistant();
    method public boolean isNotificationAssistantAccessGranted(@NonNull android.content.ComponentName);
    method public void setNotificationAssistantAccessGranted(@Nullable android.content.ComponentName, boolean);
  }

  public final class RuntimeAppOpAccessMessage implements android.os.Parcelable {
    ctor public RuntimeAppOpAccessMessage(@IntRange(from=0L) int, @IntRange(from=0L) int, @NonNull String, @Nullable String, @NonNull String, int);
    method public int describeContents();
    method @Nullable public String getFeatureId();
    method @NonNull public String getMessage();
    method @NonNull public String getOp();
    method @NonNull public String getPackageName();
    method public int getSamplingStrategy();
    method @IntRange(from=0L) public int getUid();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.RuntimeAppOpAccessMessage> CREATOR;
  }

  public class SearchManager implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
    method public void launchAssist(@Nullable android.os.Bundle);
  }

  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 @Nullable @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getData(long);
    method @Deprecated @Nullable @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getMetadata();
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public long[] getRegisteredExperimentIds() throws android.app.StatsManager.StatsUnavailableException;
    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(android.Manifest.permission.REGISTER_STATS_PULL_ATOM) public void registerPullAtomCallback(int, @Nullable android.app.StatsManager.PullAtomMetadata, @NonNull java.util.concurrent.Executor, @NonNull android.app.StatsManager.StatsPullAtomCallback);
    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 @NonNull @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public long[] setActiveConfigsChangedOperation(@Nullable android.app.PendingIntent) throws android.app.StatsManager.StatsUnavailableException;
    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;
    method @RequiresPermission(android.Manifest.permission.REGISTER_STATS_PULL_ATOM) public void unregisterPullAtomCallback(int);
    field public static final String ACTION_STATSD_STARTED = "android.app.action.STATSD_STARTED";
    field public static final String EXTRA_STATS_ACTIVE_CONFIG_KEYS = "android.app.extra.STATS_ACTIVE_CONFIG_KEYS";
    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";
    field public static final int PULL_SKIP = 1; // 0x1
    field public static final int PULL_SUCCESS = 0; // 0x0
  }

  public static class StatsManager.PullAtomMetadata {
  }

  public static class StatsManager.PullAtomMetadata.Builder {
    ctor public StatsManager.PullAtomMetadata.Builder();
    method @NonNull public android.app.StatsManager.PullAtomMetadata build();
    method @NonNull public android.app.StatsManager.PullAtomMetadata.Builder setAdditiveFields(@NonNull int[]);
    method @NonNull public android.app.StatsManager.PullAtomMetadata.Builder setCoolDownNs(long);
    method @NonNull public android.app.StatsManager.PullAtomMetadata.Builder setTimeoutNs(long);
  }

  public static interface StatsManager.StatsPullAtomCallback {
    method public int onPullAtom(int, @NonNull java.util.List<android.util.StatsEvent>);
  }

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

  public class StatusBarManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.STATUS_BAR) public android.app.StatusBarManager.DisableInfo getDisableInfo();
    method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void setDisabledForSetup(boolean);
    method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void setDisabledForSimNetworkLock(boolean);
  }

  public static final class StatusBarManager.DisableInfo {
    method public boolean areAllComponentsEnabled();
    method public boolean isNavigateToHomeDisabled();
    method public boolean isNotificationPeekingDisabled();
    method public boolean isRecentsDisabled();
    method public boolean isSearchDisabled();
    method public boolean isStatusBarExpansionDisabled();
  }

  public final class SystemServiceRegistry {
    method public static <TServiceClass> void registerContextAwareService(@NonNull String, @NonNull Class<TServiceClass>, @NonNull android.app.SystemServiceRegistry.ContextAwareServiceProducerWithBinder<TServiceClass>);
    method public static <TServiceClass> void registerContextAwareService(@NonNull String, @NonNull Class<TServiceClass>, @NonNull android.app.SystemServiceRegistry.ContextAwareServiceProducerWithoutBinder<TServiceClass>);
    method public static <TServiceClass> void registerStaticService(@NonNull String, @NonNull Class<TServiceClass>, @NonNull android.app.SystemServiceRegistry.StaticServiceProducerWithBinder<TServiceClass>);
    method public static <TServiceClass> void registerStaticService(@NonNull String, @NonNull Class<TServiceClass>, @NonNull android.app.SystemServiceRegistry.StaticServiceProducerWithoutBinder<TServiceClass>);
  }

  public static interface SystemServiceRegistry.ContextAwareServiceProducerWithBinder<TServiceClass> {
    method @NonNull public TServiceClass createService(@NonNull android.content.Context, @NonNull android.os.IBinder);
  }

  public static interface SystemServiceRegistry.ContextAwareServiceProducerWithoutBinder<TServiceClass> {
    method @NonNull public TServiceClass createService(@NonNull android.content.Context);
  }

  public static interface SystemServiceRegistry.StaticServiceProducerWithBinder<TServiceClass> {
    method @NonNull public TServiceClass createService(@NonNull android.os.IBinder);
  }

  public static interface SystemServiceRegistry.StaticServiceProducerWithoutBinder<TServiceClass> {
    method @NonNull public TServiceClass createService();
  }

  public class UiModeManager {
    method @RequiresPermission(android.Manifest.permission.ENTER_CAR_MODE_PRIORITIZED) public void enableCarMode(@IntRange(from=0) int, int);
    field public static final String ACTION_ENTER_CAR_MODE_PRIORITIZED = "android.app.action.ENTER_CAR_MODE_PRIORITIZED";
    field public static final String ACTION_EXIT_CAR_MODE_PRIORITIZED = "android.app.action.EXIT_CAR_MODE_PRIORITIZED";
    field public static final int DEFAULT_PRIORITY = 0; // 0x0
    field public static final String EXTRA_CALLING_PACKAGE = "android.app.extra.CALLING_PACKAGE";
    field public static final String EXTRA_PRIORITY = "android.app.extra.PRIORITY";
  }

  public final class Vr2dDisplayProperties implements android.os.Parcelable {
    ctor public Vr2dDisplayProperties(int, int, int);
    method public int describeContents();
    method public void dump(@NonNull java.io.PrintWriter, @NonNull String);
    method public int getAddedFlags();
    method public int getDpi();
    method public int getHeight();
    method public int getRemovedFlags();
    method public int getWidth();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.Vr2dDisplayProperties> CREATOR;
    field public static final int FLAG_VIRTUAL_DISPLAY_ENABLED = 1; // 0x1
  }

  public static final class Vr2dDisplayProperties.Builder {
    ctor public Vr2dDisplayProperties.Builder();
    method @NonNull public android.app.Vr2dDisplayProperties.Builder addFlags(int);
    method @NonNull public android.app.Vr2dDisplayProperties build();
    method @NonNull public android.app.Vr2dDisplayProperties.Builder removeFlags(int);
    method @NonNull public android.app.Vr2dDisplayProperties.Builder setDimensions(int, int, int);
    method @NonNull public android.app.Vr2dDisplayProperties.Builder setEnabled(boolean);
  }

  public class VrManager {
    method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public int getVr2dDisplayId();
    method @RequiresPermission(anyOf={android.Manifest.permission.RESTRICTED_VR_ACCESS, "android.permission.ACCESS_VR_STATE"}) public boolean isPersistentVrModeEnabled();
    method @RequiresPermission(anyOf={android.Manifest.permission.RESTRICTED_VR_ACCESS, "android.permission.ACCESS_VR_STATE"}) public boolean isVrModeEnabled();
    method @RequiresPermission(anyOf={android.Manifest.permission.RESTRICTED_VR_ACCESS, "android.permission.ACCESS_VR_STATE"}) public void registerVrStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.app.VrStateCallback);
    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);
    method @RequiresPermission("android.permission.ACCESS_VR_MANAGER") public void setStandbyEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public void setVr2dDisplayProperties(@NonNull android.app.Vr2dDisplayProperties);
    method @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public void setVrInputMethod(@Nullable android.content.ComponentName);
    method @RequiresPermission(anyOf={android.Manifest.permission.RESTRICTED_VR_ACCESS, "android.permission.ACCESS_VR_STATE"}) public void unregisterVrStateCallback(@NonNull android.app.VrStateCallback);
  }

  public abstract class VrStateCallback {
    ctor public VrStateCallback();
    method public void onPersistentVrStateChanged(boolean);
    method public void onVrStateChanged(boolean);
  }

  public final class WallpaperColors implements android.os.Parcelable {
    ctor public WallpaperColors(@NonNull android.graphics.Color, @Nullable android.graphics.Color, @Nullable android.graphics.Color, int);
    method public int getColorHints();
    field public static final int HINT_SUPPORTS_DARK_TEXT = 1; // 0x1
    field public static final int HINT_SUPPORTS_DARK_THEME = 2; // 0x2
  }

  public final class WallpaperInfo implements android.os.Parcelable {
    method public boolean supportsAmbientMode();
  }

  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 @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public boolean getBluetoothContactSharingDisabled(@NonNull android.os.UserHandle);
    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 android.os.UserHandle getDeviceOwnerUser();
    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 hasDeviceIdentifierAccess(@NonNull String, int, int);
    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.Manifest.permission.MANAGE_USERS) public boolean isManagedKiosk();
    method public boolean isSecondaryLockscreenEnabled(int);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isUnattendedManagedKiosk();
    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.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();
    method @Deprecated @RequiresPermission(value=android.Manifest.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS, conditional=true) public void setProfileOwnerCanAccessDeviceIds(@NonNull android.content.ComponentName);
    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_FINANCED_DEVICE = "android.app.action.PROVISION_FINANCED_DEVICE";
    field public static final String ACTION_PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE = "android.app.action.PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE";
    field @RequiresPermission(android.Manifest.permission.MANAGE_FACTORY_RESET_PROTECTION) public static final String ACTION_RESET_PROTECTION_POLICY_CHANGED = "android.app.action.RESET_PROTECTION_POLICY_CHANGED";
    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 String EXTRA_PROVISIONING_TRIGGER = "android.app.extra.PROVISIONING_TRIGGER";
    field public static final String EXTRA_RESTRICTION = "android.app.extra.RESTRICTION";
    field public static final int PROVISIONING_TRIGGER_CLOUD_ENROLLMENT = 1; // 0x1
    field public static final int PROVISIONING_TRIGGER_PERSISTENT_DEVICE_OWNER = 3; // 0x3
    field public static final int PROVISIONING_TRIGGER_QR_CODE = 2; // 0x2
    field public static final int PROVISIONING_TRIGGER_UNSPECIFIED = 0; // 0x0
    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.appsearch {

  public class AppSearchManagerFrameworkInitializer {
    method public static void initialize();
  }

}

package android.app.assist {

  public static class AssistStructure.ViewNode {
    ctor public AssistStructure.ViewNode();
  }

}

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 void excludeKeysFromRestore(@NonNull String, @NonNull java.util.List<java.lang.String>);
    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 @Nullable @RequiresPermission(android.Manifest.permission.BACKUP) public android.content.ComponentName getCurrentTransportComponent();
    method @RequiresPermission(android.Manifest.permission.BACKUP) public android.content.Intent getDataManagementIntent(String);
    method @Nullable @RequiresPermission(android.Manifest.permission.BACKUP) public CharSequence getDataManagementIntentLabel(@NonNull String);
    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.BACKUP) public String getDataManagementLabel(@NonNull 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 setAncestralSerialNumber(long);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public void setAutoRestore(boolean);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public void setBackupEnabled(boolean);
    method @Deprecated @RequiresPermission(android.Manifest.permission.BACKUP) public void updateTransportAttributes(@NonNull android.content.ComponentName, @NonNull String, @Nullable android.content.Intent, @NonNull String, @Nullable android.content.Intent, @Nullable String);
    method @RequiresPermission(android.Manifest.permission.BACKUP) public void updateTransportAttributes(@NonNull android.content.ComponentName, @NonNull String, @Nullable android.content.Intent, @NonNull String, @Nullable android.content.Intent, @Nullable CharSequence);
    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 @NonNull 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 @Nullable public CharSequence dataManagementIntentLabel();
    method @Deprecated @Nullable 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_DATA_NOT_CHANGED = 8; // 0x8
    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 @NonNull 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);
    method public int restorePackages(long, @Nullable android.app.backup.RestoreObserver, @NonNull java.util.Set<java.lang.String>, @Nullable android.app.backup.BackupManagerMonitor);
    method public int restorePackages(long, @Nullable android.app.backup.RestoreObserver, @NonNull java.util.Set<java.lang.String>);
  }

  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 @NonNull 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.compat {

  public final class CompatChanges {
    method public static boolean isChangeEnabled(long);
    method public static boolean isChangeEnabled(long, @NonNull String, @NonNull android.os.UserHandle);
    method public static boolean isChangeEnabled(long, int);
  }

}

package android.app.contentsuggestions {

  public final class ClassificationsRequest implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.os.Bundle getExtras();
    method @NonNull public java.util.List<android.app.contentsuggestions.ContentSelection> getSelections();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.contentsuggestions.ClassificationsRequest> CREATOR;
  }

  public static final class ClassificationsRequest.Builder {
    ctor public ClassificationsRequest.Builder(@NonNull java.util.List<android.app.contentsuggestions.ContentSelection>);
    method @NonNull public android.app.contentsuggestions.ClassificationsRequest build();
    method @NonNull public android.app.contentsuggestions.ClassificationsRequest.Builder setExtras(@NonNull android.os.Bundle);
  }

  public final class ContentClassification implements android.os.Parcelable {
    ctor public ContentClassification(@NonNull String, @NonNull android.os.Bundle);
    method public int describeContents();
    method @NonNull public android.os.Bundle getExtras();
    method @NonNull public String getId();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.contentsuggestions.ContentClassification> CREATOR;
  }

  public final class ContentSelection implements android.os.Parcelable {
    ctor public ContentSelection(@NonNull String, @NonNull android.os.Bundle);
    method public int describeContents();
    method @NonNull public android.os.Bundle getExtras();
    method @NonNull public String getId();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.contentsuggestions.ContentSelection> CREATOR;
  }

  public final class ContentSuggestionsManager {
    method public void classifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull java.util.concurrent.Executor, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback);
    method public boolean isEnabled();
    method public void notifyInteraction(@NonNull String, @NonNull android.os.Bundle);
    method public void provideContextImage(@NonNull android.graphics.Bitmap, @NonNull android.os.Bundle);
    method public void provideContextImage(int, @NonNull android.os.Bundle);
    method public void suggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull java.util.concurrent.Executor, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback);
  }

  public static interface ContentSuggestionsManager.ClassificationsCallback {
    method public void onContentClassificationsAvailable(int, @NonNull java.util.List<android.app.contentsuggestions.ContentClassification>);
  }

  public static interface ContentSuggestionsManager.SelectionsCallback {
    method public void onContentSelectionsAvailable(int, @NonNull java.util.List<android.app.contentsuggestions.ContentSelection>);
  }

  public final class SelectionsRequest implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.os.Bundle getExtras();
    method @Nullable public android.graphics.Point getInterestPoint();
    method public int getTaskId();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.contentsuggestions.SelectionsRequest> CREATOR;
  }

  public static final class SelectionsRequest.Builder {
    ctor public SelectionsRequest.Builder(int);
    method @NonNull public android.app.contentsuggestions.SelectionsRequest build();
    method @NonNull public android.app.contentsuggestions.SelectionsRequest.Builder setExtras(@NonNull android.os.Bundle);
    method @NonNull public android.app.contentsuggestions.SelectionsRequest.Builder setInterestPoint(@NonNull android.graphics.Point);
  }

}

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);
  }

  public class JobSchedulerFrameworkInitializer {
    method public static void registerServiceWrappers();
  }

}

package android.app.prediction {

  public final class AppPredictionContext implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.os.Bundle getExtras();
    method @NonNull public String getPackageName();
    method @IntRange(from=0) public int getPredictedTargetCount();
    method @NonNull public String getUiSurface();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.prediction.AppPredictionContext> CREATOR;
  }

  public static final class AppPredictionContext.Builder {
    ctor public AppPredictionContext.Builder(@NonNull android.content.Context);
    method @NonNull public android.app.prediction.AppPredictionContext build();
    method @NonNull public android.app.prediction.AppPredictionContext.Builder setExtras(@Nullable android.os.Bundle);
    method @NonNull public android.app.prediction.AppPredictionContext.Builder setPredictedTargetCount(@IntRange(from=0) int);
    method @NonNull public android.app.prediction.AppPredictionContext.Builder setUiSurface(@NonNull String);
  }

  public final class AppPredictionManager {
    method @NonNull public android.app.prediction.AppPredictor createAppPredictionSession(@NonNull android.app.prediction.AppPredictionContext);
  }

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

  public final class AppPredictor {
    method public void destroy();
    method public void notifyAppTargetEvent(@NonNull android.app.prediction.AppTargetEvent);
    method public void notifyLaunchLocationShown(@NonNull String, @NonNull java.util.List<android.app.prediction.AppTargetId>);
    method public void registerPredictionUpdates(@NonNull java.util.concurrent.Executor, @NonNull android.app.prediction.AppPredictor.Callback);
    method public void requestPredictionUpdate();
    method @Nullable public void sortTargets(@NonNull java.util.List<android.app.prediction.AppTarget>, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.util.List<android.app.prediction.AppTarget>>);
    method public void unregisterPredictionUpdates(@NonNull android.app.prediction.AppPredictor.Callback);
  }

  public static interface AppPredictor.Callback {
    method public void onTargetsAvailable(@NonNull java.util.List<android.app.prediction.AppTarget>);
  }

  public final class AppTarget implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getClassName();
    method @NonNull public android.app.prediction.AppTargetId getId();
    method @NonNull public String getPackageName();
    method @IntRange(from=0) public int getRank();
    method @Nullable public android.content.pm.ShortcutInfo getShortcutInfo();
    method @NonNull public android.os.UserHandle getUser();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.prediction.AppTarget> CREATOR;
  }

  public static final class AppTarget.Builder {
    ctor public AppTarget.Builder(@NonNull android.app.prediction.AppTargetId, @NonNull String, @NonNull android.os.UserHandle);
    ctor public AppTarget.Builder(@NonNull android.app.prediction.AppTargetId, @NonNull android.content.pm.ShortcutInfo);
    method @NonNull public android.app.prediction.AppTarget build();
    method @NonNull public android.app.prediction.AppTarget.Builder setClassName(@NonNull String);
    method @NonNull public android.app.prediction.AppTarget.Builder setRank(@IntRange(from=0) int);
  }

  public final class AppTargetEvent implements android.os.Parcelable {
    method public int describeContents();
    method public int getAction();
    method @Nullable public String getLaunchLocation();
    method @Nullable public android.app.prediction.AppTarget getTarget();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ACTION_DISMISS = 2; // 0x2
    field public static final int ACTION_LAUNCH = 1; // 0x1
    field public static final int ACTION_PIN = 3; // 0x3
    field public static final int ACTION_UNPIN = 4; // 0x4
    field @NonNull public static final android.os.Parcelable.Creator<android.app.prediction.AppTargetEvent> CREATOR;
  }

  public static final class AppTargetEvent.Builder {
    ctor public AppTargetEvent.Builder(@Nullable android.app.prediction.AppTarget, int);
    method @NonNull public android.app.prediction.AppTargetEvent build();
    method @NonNull public android.app.prediction.AppTargetEvent.Builder setLaunchLocation(@Nullable String);
  }

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

}

package android.app.role {

  public interface OnRoleHoldersChangedListener {
    method public void onRoleHoldersChanged(@NonNull String, @NonNull android.os.UserHandle);
  }

  public abstract class RoleControllerService extends android.app.Service {
    ctor public RoleControllerService();
    method @WorkerThread public abstract boolean onAddRoleHolder(@NonNull String, @NonNull String, int);
    method @Nullable public final android.os.IBinder onBind(@Nullable android.content.Intent);
    method @WorkerThread public abstract boolean onClearRoleHolders(@NonNull String, int);
    method @WorkerThread public abstract boolean onGrantDefaultRoles();
    method @Deprecated public abstract boolean onIsApplicationQualifiedForRole(@NonNull String, @NonNull String);
    method public boolean onIsApplicationVisibleForRole(@NonNull String, @NonNull String);
    method public abstract boolean onIsRoleVisible(@NonNull String);
    method @WorkerThread public abstract boolean onRemoveRoleHolder(@NonNull String, @NonNull String, int);
    field public static final String SERVICE_INTERFACE = "android.app.role.RoleControllerService";
  }

  public final class RoleManager {
    method @RequiresPermission(android.Manifest.permission.OBSERVE_ROLE_HOLDERS) public void addOnRoleHoldersChangedListenerAsUser(@NonNull java.util.concurrent.Executor, @NonNull android.app.role.OnRoleHoldersChangedListener, @NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void addRoleHolderAsUser(@NonNull String, @NonNull String, int, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public boolean addRoleHolderFromController(@NonNull String, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void clearRoleHoldersAsUser(@NonNull String, int, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @Nullable public String getDefaultSmsPackage(int);
    method @NonNull @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public java.util.List<java.lang.String> getHeldRolesFromController(@NonNull String);
    method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public java.util.List<java.lang.String> getRoleHolders(@NonNull String);
    method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public java.util.List<java.lang.String> getRoleHoldersAsUser(@NonNull String, @NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.OBSERVE_ROLE_HOLDERS) public void removeOnRoleHoldersChangedListenerAsUser(@NonNull android.app.role.OnRoleHoldersChangedListener, @NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public void removeRoleHolderAsUser(@NonNull String, @NonNull String, int, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public boolean removeRoleHolderFromController(@NonNull String, @NonNull String);
    method @RequiresPermission("com.android.permissioncontroller.permission.MANAGE_ROLES_FROM_CONTROLLER") public void setRoleNamesFromController(@NonNull java.util.List<java.lang.String>);
    field public static final int MANAGE_HOLDERS_FLAG_DONT_KILL_APP = 1; // 0x1
  }

}

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 @NonNull 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 class NetworkStatsManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.net.netstats.provider.NetworkStatsProviderCallback registerNetworkStatsProvider(@NonNull String, @NonNull android.net.netstats.provider.AbstractNetworkStatsProvider);
  }

  public static final class UsageEvents.Event {
    method public int getInstanceId();
    method @Nullable public String getNotificationChannelId();
    method @Nullable public String getTaskRootClassName();
    method @Nullable public String getTaskRootPackageName();
    method public boolean isInstantApp();
    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 public int getUsageSource();
    method @RequiresPermission(android.Manifest.permission.BIND_CARRIER_SERVICES) public void onCarrierPrivilegedAppsChanged();
    method @RequiresPermission(allOf={android.Manifest.permission.SUSPEND_APPS, android.Manifest.permission.OBSERVE_APP_USAGE}) public void registerAppUsageLimitObserver(int, @NonNull String[], @NonNull java.time.Duration, @NonNull java.time.Duration, @Nullable android.app.PendingIntent);
    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.OBSERVE_APP_USAGE) public void registerUsageSessionObserver(int, @NonNull String[], @NonNull java.time.Duration, @NonNull java.time.Duration, @NonNull android.app.PendingIntent, @Nullable android.app.PendingIntent);
    method public void reportUsageStart(@NonNull android.app.Activity, @NonNull String);
    method public void reportUsageStart(@NonNull android.app.Activity, @NonNull String, long);
    method public void reportUsageStop(@NonNull android.app.Activity, @NonNull String);
    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(allOf={android.Manifest.permission.SUSPEND_APPS, android.Manifest.permission.OBSERVE_APP_USAGE}) public void unregisterAppUsageLimitObserver(int);
    method @RequiresPermission(android.Manifest.permission.OBSERVE_APP_USAGE) public void unregisterAppUsageObserver(int);
    method @RequiresPermission(android.Manifest.permission.OBSERVE_APP_USAGE) public void unregisterUsageSessionObserver(int);
    method @Deprecated @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
    field public static final int USAGE_SOURCE_CURRENT_ACTIVITY = 2; // 0x2
    field public static final int USAGE_SOURCE_TASK_ROOT_ACTIVITY = 1; // 0x1
  }

}

package android.bluetooth {

  public final class BluetoothA2dp implements android.bluetooth.BluetoothProfile {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void disableOptionalCodecs(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void enableOptionalCodecs(@Nullable android.bluetooth.BluetoothDevice);
    method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothDevice getActiveDevice();
    method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothCodecStatus getCodecStatus(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public int getOptionalCodecsEnabled(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setCodecConfigPreference(@Nullable android.bluetooth.BluetoothDevice, @Nullable android.bluetooth.BluetoothCodecConfig);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setOptionalCodecsEnabled(@Nullable android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public int supportsOptionalCodecs(@Nullable android.bluetooth.BluetoothDevice);
    field public static final int OPTIONAL_CODECS_NOT_SUPPORTED = 0; // 0x0
    field public static final int OPTIONAL_CODECS_PREF_DISABLED = 0; // 0x0
    field public static final int OPTIONAL_CODECS_PREF_ENABLED = 1; // 0x1
    field public static final int OPTIONAL_CODECS_PREF_UNKNOWN = -1; // 0xffffffff
    field public static final int OPTIONAL_CODECS_SUPPORTED = 1; // 0x1
    field public static final int OPTIONAL_CODECS_SUPPORT_UNKNOWN = -1; // 0xffffffff
  }

  public final class BluetoothA2dpSink implements android.bluetooth.BluetoothProfile {
    method public void finalize();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isAudioPlaying(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice, int);
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.a2dp-sink.profile.action.CONNECTION_STATE_CHANGED";
  }

  public final class BluetoothAdapter {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean addOnMetadataChangedListener(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.OnMetadataChangedListener);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean connectAllEnabledProfiles(@NonNull android.bluetooth.BluetoothDevice);
    method public boolean disableBLE();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean disconnectAllEnabledProfiles(@NonNull android.bluetooth.BluetoothDevice);
    method public boolean enableBLE();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean enableNoAutoConnect();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean factoryReset();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public long getDiscoveryEndMillis();
    method public boolean isBleScanAlwaysAvailable();
    method public boolean isLeEnabled();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean removeActiveDevice(int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean removeOnMetadataChangedListener(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.BluetoothAdapter.OnMetadataChangedListener);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setActiveDevice(@NonNull android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setScanMode(int, long);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setScanMode(int);
    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";
    field public static final int ACTIVE_DEVICE_ALL = 2; // 0x2
    field public static final int ACTIVE_DEVICE_AUDIO = 0; // 0x0
    field public static final int ACTIVE_DEVICE_PHONE_CALL = 1; // 0x1
  }

  public static interface BluetoothAdapter.OnMetadataChangedListener {
    method public void onMetadataChanged(@NonNull android.bluetooth.BluetoothDevice, int, @Nullable byte[]);
  }

  public final class BluetoothCodecConfig implements android.os.Parcelable {
    ctor public BluetoothCodecConfig(int, int, int, int, int, long, long, long, long);
    ctor public BluetoothCodecConfig(int);
    method public int getBitsPerSample();
    method @NonNull public String getCodecName();
    method public int getCodecPriority();
    method public long getCodecSpecific1();
    method public int getCodecType();
    method public int getSampleRate();
    method public boolean isMandatoryCodec();
    field public static final int BITS_PER_SAMPLE_16 = 1; // 0x1
    field public static final int BITS_PER_SAMPLE_24 = 2; // 0x2
    field public static final int BITS_PER_SAMPLE_32 = 4; // 0x4
    field public static final int BITS_PER_SAMPLE_NONE = 0; // 0x0
    field public static final int CHANNEL_MODE_MONO = 1; // 0x1
    field public static final int CHANNEL_MODE_NONE = 0; // 0x0
    field public static final int CHANNEL_MODE_STEREO = 2; // 0x2
    field public static final int CODEC_PRIORITY_DEFAULT = 0; // 0x0
    field public static final int CODEC_PRIORITY_DISABLED = -1; // 0xffffffff
    field public static final int CODEC_PRIORITY_HIGHEST = 1000000; // 0xf4240
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothCodecConfig> CREATOR;
    field public static final int SAMPLE_RATE_176400 = 16; // 0x10
    field public static final int SAMPLE_RATE_192000 = 32; // 0x20
    field public static final int SAMPLE_RATE_44100 = 1; // 0x1
    field public static final int SAMPLE_RATE_48000 = 2; // 0x2
    field public static final int SAMPLE_RATE_88200 = 4; // 0x4
    field public static final int SAMPLE_RATE_96000 = 8; // 0x8
    field public static final int SAMPLE_RATE_NONE = 0; // 0x0
    field public static final int SOURCE_CODEC_TYPE_AAC = 1; // 0x1
    field public static final int SOURCE_CODEC_TYPE_APTX = 2; // 0x2
    field public static final int SOURCE_CODEC_TYPE_APTX_HD = 3; // 0x3
    field public static final int SOURCE_CODEC_TYPE_INVALID = 1000000; // 0xf4240
    field public static final int SOURCE_CODEC_TYPE_LDAC = 4; // 0x4
    field public static final int SOURCE_CODEC_TYPE_MAX = 5; // 0x5
    field public static final int SOURCE_CODEC_TYPE_SBC = 0; // 0x0
  }

  public final class BluetoothCodecStatus implements android.os.Parcelable {
    ctor public BluetoothCodecStatus(@Nullable android.bluetooth.BluetoothCodecConfig, @Nullable android.bluetooth.BluetoothCodecConfig[], @Nullable android.bluetooth.BluetoothCodecConfig[]);
    method @Nullable public android.bluetooth.BluetoothCodecConfig getCodecConfig();
    method @Nullable public android.bluetooth.BluetoothCodecConfig[] getCodecsLocalCapabilities();
    method @Nullable public android.bluetooth.BluetoothCodecConfig[] getCodecsSelectableCapabilities();
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothCodecStatus> CREATOR;
    field public static final String EXTRA_CODEC_STATUS = "android.bluetooth.extra.CODEC_STATUS";
  }

  public final class BluetoothDevice implements android.os.Parcelable {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean cancelBondProcess();
    method public boolean cancelPairing();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getBatteryLevel();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getMessageAccessPermission();
    method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public byte[] getMetadata(int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getPhonebookAccessPermission();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getSimAccessPermission();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isBondingInitiatedLocally();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isConnected();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isEncrypted();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isInSilenceMode();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean removeBond();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setAlias(@NonNull String);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setMessageAccessPermission(int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setMetadata(int, @NonNull byte[]);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setPhonebookAccessPermission(int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setPin(@Nullable String);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setSilenceMode(boolean);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setSimAccessPermission(int);
    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 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_UNTETHERED_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_UNTETHERED_CASE_BATTERY = 12; // 0xc
    field public static final int METADATA_UNTETHERED_CASE_CHARGING = 15; // 0xf
    field public static final int METADATA_UNTETHERED_CASE_ICON = 9; // 0x9
    field public static final int METADATA_UNTETHERED_LEFT_BATTERY = 10; // 0xa
    field public static final int METADATA_UNTETHERED_LEFT_CHARGING = 13; // 0xd
    field public static final int METADATA_UNTETHERED_LEFT_ICON = 7; // 0x7
    field public static final int METADATA_UNTETHERED_RIGHT_BATTERY = 11; // 0xb
    field public static final int METADATA_UNTETHERED_RIGHT_CHARGING = 14; // 0xe
    field public static final int METADATA_UNTETHERED_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 @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH) public android.bluetooth.BluetoothDevice getActiveDevice();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setPriority(android.bluetooth.BluetoothDevice, int);
  }

  public final class BluetoothHearingAid implements android.bluetooth.BluetoothProfile {
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH) public java.util.List<android.bluetooth.BluetoothDevice> getActiveDevices();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public long getHiSyncId(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
  }

  public final class BluetoothHidDevice implements android.bluetooth.BluetoothProfile {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
  }

  public final class BluetoothHidHost implements android.bluetooth.BluetoothProfile {
    method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice);
    method public int getConnectionState(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice, int);
    field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.input.profile.action.CONNECTION_STATE_CHANGED";
  }

  public final class BluetoothMap implements android.bluetooth.BluetoothProfile {
    method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice, int);
    field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.map.profile.action.CONNECTION_STATE_CHANGED";
  }

  public final class BluetoothPan implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public void close();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) protected void finalize();
    method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public int getConnectionState(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean isTetheringOn();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public void setBluetoothTethering(boolean);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED";
    field public static final String EXTRA_LOCAL_ROLE = "android.bluetooth.pan.extra.LOCAL_ROLE";
    field public static final int LOCAL_NAP_ROLE = 1; // 0x1
    field public static final int LOCAL_PANU_ROLE = 2; // 0x2
    field public static final int PAN_ROLE_NONE = 0; // 0x0
    field public static final int REMOTE_NAP_ROLE = 1; // 0x1
    field public static final int REMOTE_PANU_ROLE = 2; // 0x2
  }

  public class BluetoothPbap implements android.bluetooth.BluetoothProfile {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionState(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pbap.profile.action.CONNECTION_STATE_CHANGED";
  }

  public interface BluetoothProfile {
    field public static final int A2DP_SINK = 11; // 0xb
    field public static final int AVRCP_CONTROLLER = 12; // 0xc
    field public static final int CONNECTION_POLICY_ALLOWED = 100; // 0x64
    field public static final int CONNECTION_POLICY_FORBIDDEN = 0; // 0x0
    field public static final int CONNECTION_POLICY_UNKNOWN = -1; // 0xffffffff
    field public static final int HEADSET_CLIENT = 16; // 0x10
    field public static final int PAN = 5; // 0x5
    field public static final int PBAP_CLIENT = 17; // 0x11
    field @Deprecated public static final int PRIORITY_OFF = 0; // 0x0
    field @Deprecated public static final int PRIORITY_ON = 100; // 0x64
  }

  public final class BluetoothUuid {
    method public static boolean containsAnyUuid(@Nullable android.os.ParcelUuid[], @Nullable android.os.ParcelUuid[]);
    method @NonNull public static android.os.ParcelUuid parseUuidFrom(@Nullable byte[]);
    field @NonNull public static final android.os.ParcelUuid A2DP_SINK;
    field @NonNull public static final android.os.ParcelUuid A2DP_SOURCE;
    field @NonNull public static final android.os.ParcelUuid ADV_AUDIO_DIST;
    field @NonNull public static final android.os.ParcelUuid AVRCP_CONTROLLER;
    field @NonNull public static final android.os.ParcelUuid AVRCP_TARGET;
    field @NonNull public static final android.os.ParcelUuid BASE_UUID;
    field @NonNull public static final android.os.ParcelUuid BNEP;
    field @NonNull public static final android.os.ParcelUuid HEARING_AID;
    field @NonNull public static final android.os.ParcelUuid HFP;
    field @NonNull public static final android.os.ParcelUuid HFP_AG;
    field @NonNull public static final android.os.ParcelUuid HID;
    field @NonNull public static final android.os.ParcelUuid HOGP;
    field @NonNull public static final android.os.ParcelUuid HSP;
    field @NonNull public static final android.os.ParcelUuid HSP_AG;
    field @NonNull public static final android.os.ParcelUuid MAP;
    field @NonNull public static final android.os.ParcelUuid MAS;
    field @NonNull public static final android.os.ParcelUuid MNS;
    field @NonNull public static final android.os.ParcelUuid NAP;
    field @NonNull public static final android.os.ParcelUuid OBEX_OBJECT_PUSH;
    field @NonNull public static final android.os.ParcelUuid PANU;
    field @NonNull public static final android.os.ParcelUuid PBAP_PCE;
    field @NonNull public static final android.os.ParcelUuid PBAP_PSE;
    field @NonNull public static final android.os.ParcelUuid SAP;
    field public static final int UUID_BYTES_128_BIT = 16; // 0x10
    field public static final int UUID_BYTES_16_BIT = 2; // 0x2
    field public static final int UUID_BYTES_32_BIT = 4; // 0x4
  }

}

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 @NonNull 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.companion {

  public final class CompanionDeviceManager {
    method @RequiresPermission("android.permission.MANAGE_COMPANION_DEVICES") public boolean isDeviceAssociatedForWifiConnection(@NonNull String, @NonNull android.net.MacAddress, @NonNull android.os.UserHandle);
  }

}

package android.content {

  public class ApexContext {
    method @NonNull public static android.content.ApexContext getApexContext(@NonNull String);
    method @NonNull public java.io.File getCredentialProtectedDataDirForUser(@NonNull android.os.UserHandle);
    method @NonNull public java.io.File getDeviceProtectedDataDir();
    method @NonNull public java.io.File getDeviceProtectedDataDirForUser(@NonNull android.os.UserHandle);
  }

  public abstract class BroadcastReceiver {
    method @NonNull public final android.os.UserHandle getSendingUser();
  }

  public abstract class ContentProvider implements android.content.ComponentCallbacks2 {
    method public int checkUriPermission(@NonNull android.net.Uri, int, int);
  }

  public class ContentProviderClient implements java.lang.AutoCloseable {
    method @RequiresPermission(android.Manifest.permission.REMOVE_TASKS) public void setDetectNotResponding(long);
  }

  public abstract class ContentResolver {
    method @NonNull public static android.net.Uri decodeFromFile(@NonNull java.io.File);
    method @NonNull public static java.io.File encodeToFile(@NonNull android.net.Uri);
    method @Nullable @RequiresPermission("android.permission.CACHE_CONTENT") public android.os.Bundle getCache(@NonNull android.net.Uri);
    method @RequiresPermission("android.permission.CACHE_CONTENT") public void putCache(@NonNull android.net.Uri, @Nullable android.os.Bundle);
  }

  public abstract class Context {
    method @NonNull public android.content.Context createContextAsUser(@NonNull android.os.UserHandle, int);
    method public abstract android.content.Context createCredentialProtectedStorageContext();
    method @NonNull public android.content.Context createPackageContextAsUser(@NonNull String, int, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
    method @Nullable public abstract java.io.File getPreloadsFileCache();
    method public abstract boolean isCredentialProtectedStorage();
    method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public android.content.Intent registerReceiverForAllUsers(@Nullable android.content.BroadcastReceiver, @NonNull android.content.IntentFilter, @Nullable String, @Nullable android.os.Handler);
    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) public void startActivityAsUser(@NonNull @RequiresPermission android.content.Intent, @NonNull android.os.UserHandle);
    field public static final String APP_INTEGRITY_SERVICE = "app_integrity";
    field public static final String APP_PREDICTION_SERVICE = "app_prediction";
    field public static final String BACKUP_SERVICE = "backup";
    field public static final String BATTERY_STATS_SERVICE = "batterystats";
    field public static final String BUGREPORT_SERVICE = "bugreport";
    field public static final String CONTENT_SUGGESTIONS_SERVICE = "content_suggestions";
    field public static final String CONTEXTHUB_SERVICE = "contexthub";
    field public static final String ETHERNET_SERVICE = "ethernet";
    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_POLICY_SERVICE = "netpolicy";
    field public static final String NETWORK_SCORE_SERVICE = "network_score";
    field public static final String NETWORK_STACK_SERVICE = "network_stack";
    field public static final String OEM_LOCK_SERVICE = "oem_lock";
    field public static final String PERMISSION_SERVICE = "permission";
    field public static final String PERSISTENT_DATA_BLOCK_SERVICE = "persistent_data_block";
    field public static final String ROLLBACK_SERVICE = "rollback";
    field public static final String SECURE_ELEMENT_SERVICE = "secure_element";
    field public static final String STATS_MANAGER = "stats";
    field public static final String STATUS_BAR_SERVICE = "statusbar";
    field public static final String SYSTEM_CONFIG_SERVICE = "system_config";
    field public static final String SYSTEM_UPDATE_SERVICE = "system_update";
    field public static final String TELEPHONY_REGISTRY_SERVICE = "telephony_registry";
    field public static final String TETHERING_SERVICE = "tethering";
    field public static final String VR_SERVICE = "vrmanager";
    field public static final String WIFI_NL80211_SERVICE = "wifinl80211";
    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 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_DEVICE_CUSTOMIZATION_READY = "android.intent.action.DEVICE_CUSTOMIZATION_READY";
    field public static final String ACTION_DIAL_EMERGENCY = "android.intent.action.DIAL_EMERGENCY";
    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_INCIDENT_REPORT_READY = "android.intent.action.INCIDENT_REPORT_READY";
    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_LOAD_DATA = "android.intent.action.LOAD_DATA";
    field @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public static final String ACTION_MANAGE_APP_PERMISSION = "android.intent.action.MANAGE_APP_PERMISSION";
    field public static final String ACTION_MANAGE_APP_PERMISSIONS = "android.intent.action.MANAGE_APP_PERMISSIONS";
    field @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public static final String ACTION_MANAGE_DEFAULT_APP = "android.intent.action.MANAGE_DEFAULT_APP";
    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 @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public static final String ACTION_MANAGE_SPECIAL_APP_ACCESSES = "android.intent.action.MANAGE_SPECIAL_APP_ACCESSES";
    field public static final String ACTION_MASTER_CLEAR_NOTIFICATION = "android.intent.action.MASTER_CLEAR_NOTIFICATION";
    field public static final String ACTION_PACKAGE_NEEDS_INTEGRITY_VERIFICATION = "android.intent.action.PACKAGE_NEEDS_INTEGRITY_VERIFICATION";
    field public static final String ACTION_PACKAGE_UNSUSPENDED_MANUALLY = "android.intent.action.PACKAGE_UNSUSPENDED_MANUALLY";
    field public static final String ACTION_PENDING_INCIDENT_REPORTS_CHANGED = "android.intent.action.PENDING_INCIDENT_REPORTS_CHANGED";
    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 @RequiresPermission(android.Manifest.permission.REVIEW_ACCESSIBILITY_SERVICES) public static final String ACTION_REVIEW_ACCESSIBILITY_SERVICES = "android.intent.action.REVIEW_ACCESSIBILITY_SERVICES";
    field @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public static final String ACTION_REVIEW_ONGOING_PERMISSION_USAGE = "android.intent.action.REVIEW_ONGOING_PERMISSION_USAGE";
    field public static final String ACTION_REVIEW_PERMISSIONS = "android.intent.action.REVIEW_PERMISSIONS";
    field @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public static final String ACTION_REVIEW_PERMISSION_USAGE = "android.intent.action.REVIEW_PERMISSION_USAGE";
    field public static final String ACTION_ROLLBACK_COMMITTED = "android.intent.action.ROLLBACK_COMMITTED";
    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_ADDED = "android.intent.action.USER_ADDED";
    field public static final String ACTION_USER_REMOVED = "android.intent.action.USER_REMOVED";
    field @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public static final String ACTION_USER_SWITCHED = "android.intent.action.USER_SWITCHED";
    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_GROUP_NAME = "android.intent.extra.PERMISSION_GROUP_NAME";
    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 @Deprecated public static final String EXTRA_REBROADCAST_ON_UNLOCK = "rebroadcastOnUnlock";
    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_ROLE_NAME = "android.intent.extra.ROLE_NAME";
    field @Deprecated public static final String EXTRA_SIM_LOCKED_REASON = "reason";
    field @Deprecated public static final String EXTRA_SIM_STATE = "ss";
    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";
    field public static final int FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT = 67108864; // 0x4000000
    field public static final String METADATA_SETUP_VERSION = "android.SETUP_VERSION";
    field @Deprecated public static final String SIM_ABSENT_ON_PERM_DISABLED = "PERM_DISABLED";
    field @Deprecated public static final String SIM_LOCKED_NETWORK = "NETWORK";
    field @Deprecated public static final String SIM_LOCKED_ON_PIN = "PIN";
    field @Deprecated public static final String SIM_LOCKED_ON_PUK = "PUK";
    field @Deprecated public static final String SIM_STATE_ABSENT = "ABSENT";
    field @Deprecated public static final String SIM_STATE_CARD_IO_ERROR = "CARD_IO_ERROR";
    field @Deprecated public static final String SIM_STATE_CARD_RESTRICTED = "CARD_RESTRICTED";
    field @Deprecated public static final String SIM_STATE_IMSI = "IMSI";
    field @Deprecated public static final String SIM_STATE_LOADED = "LOADED";
    field @Deprecated public static final String SIM_STATE_LOCKED = "LOCKED";
    field @Deprecated public static final String SIM_STATE_NOT_READY = "NOT_READY";
    field @Deprecated public static final String SIM_STATE_PRESENT = "PRESENT";
    field @Deprecated public static final String SIM_STATE_READY = "READY";
    field @Deprecated public static final String SIM_STATE_UNKNOWN = "UNKNOWN";
  }

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

}

package android.content.integrity {

  public class AppIntegrityManager {
    method @NonNull public String getCurrentRuleSetProvider();
    method @NonNull public String getCurrentRuleSetVersion();
    method public void updateRuleSet(@NonNull android.content.integrity.RuleSet, @NonNull android.content.IntentSender);
    field public static final String EXTRA_STATUS = "android.content.integrity.extra.STATUS";
    field public static final int STATUS_FAILURE = 1; // 0x1
    field public static final int STATUS_SUCCESS = 0; // 0x0
  }

  public abstract class IntegrityFormula {
    method @NonNull public static android.content.integrity.IntegrityFormula all(@NonNull android.content.integrity.IntegrityFormula...);
    method @NonNull public static android.content.integrity.IntegrityFormula any(@NonNull android.content.integrity.IntegrityFormula...);
    method @NonNull public static android.content.integrity.IntegrityFormula not(@NonNull android.content.integrity.IntegrityFormula);
  }

  public static final class IntegrityFormula.Application {
    method @NonNull public static android.content.integrity.IntegrityFormula certificatesContain(@NonNull String);
    method @NonNull public static android.content.integrity.IntegrityFormula isPreInstalled();
    method @NonNull public static android.content.integrity.IntegrityFormula packageNameEquals(@NonNull String);
    method @NonNull public static android.content.integrity.IntegrityFormula versionCodeEquals(@NonNull long);
    method @NonNull public static android.content.integrity.IntegrityFormula versionCodeGreaterThan(@NonNull long);
    method @NonNull public static android.content.integrity.IntegrityFormula versionCodeGreaterThanOrEqualTo(@NonNull long);
  }

  public static final class IntegrityFormula.Installer {
    method @NonNull public static android.content.integrity.IntegrityFormula certificatesContain(@NonNull String);
    method @NonNull public static android.content.integrity.IntegrityFormula notAllowedByManifest();
    method @NonNull public static android.content.integrity.IntegrityFormula packageNameEquals(@NonNull String);
  }

  public static final class IntegrityFormula.SourceStamp {
    method @NonNull public static android.content.integrity.IntegrityFormula notTrusted();
    method @NonNull public static android.content.integrity.IntegrityFormula stampCertificateHashEquals(@NonNull String);
  }

  public final class Rule implements android.os.Parcelable {
    ctor public Rule(@NonNull android.content.integrity.IntegrityFormula, int);
    method public int describeContents();
    method public int getEffect();
    method @NonNull public android.content.integrity.IntegrityFormula getFormula();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.integrity.Rule> CREATOR;
    field public static final int DENY = 0; // 0x0
    field public static final int FORCE_ALLOW = 1; // 0x1
  }

  public class RuleSet {
    method @NonNull public java.util.List<android.content.integrity.Rule> getRules();
    method @NonNull public String getVersion();
  }

  public static class RuleSet.Builder {
    ctor public RuleSet.Builder();
    method @NonNull public android.content.integrity.RuleSet.Builder addRules(@NonNull java.util.List<android.content.integrity.Rule>);
    method @NonNull public android.content.integrity.RuleSet build();
    method @NonNull public android.content.integrity.RuleSet.Builder setVersion(@NonNull String);
  }

}

package android.content.om {

  public final class OverlayInfo implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getCategory();
    method @NonNull public String getPackageName();
    method @Nullable public String getTargetOverlayableName();
    method @NonNull public String getTargetPackageName();
    method public int getUserId();
    method public boolean isEnabled();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.om.OverlayInfo> CREATOR;
  }

  public class OverlayManager {
    method @Nullable public android.content.om.OverlayInfo getOverlayInfo(@NonNull String, @NonNull android.os.UserHandle);
    method @NonNull @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public java.util.List<android.content.om.OverlayInfo> getOverlayInfosForTarget(@NonNull String, @NonNull android.os.UserHandle);
    method @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public void setEnabled(@NonNull String, boolean, @NonNull android.os.UserHandle) throws java.lang.IllegalStateException, java.lang.SecurityException;
    method @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public void setEnabledExclusiveInCategory(@NonNull String, @NonNull android.os.UserHandle) throws java.lang.IllegalStateException, java.lang.SecurityException;
  }

}

package android.content.pm {

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

  public class CrossProfileApps {
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_PROFILES) public void startActivity(@NonNull android.content.ComponentName, @NonNull android.os.UserHandle);
  }

  public class DataLoaderParams {
    method @NonNull public static final android.content.pm.DataLoaderParams forIncremental(@NonNull android.content.ComponentName, @NonNull String, @Nullable java.util.Map<java.lang.String,android.os.ParcelFileDescriptor>);
    method @NonNull public static final android.content.pm.DataLoaderParams forStreaming(@NonNull android.content.ComponentName, @NonNull String);
    method @NonNull public final String getArguments();
    method @NonNull public final android.content.ComponentName getComponentName();
    method @NonNull public final java.util.Map<java.lang.String,android.os.ParcelFileDescriptor> getDynamicArgs();
    method @NonNull public final int getType();
  }

  public final class InstallationFile implements android.os.Parcelable {
    ctor public InstallationFile(int, @NonNull String, long, @Nullable byte[], @Nullable byte[]);
    method public int describeContents();
    method public long getLengthBytes();
    method public int getLocation();
    method @Nullable public byte[] getMetadata();
    method @NonNull public String getName();
    method @Nullable public byte[] getSignature();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstallationFile> CREATOR;
  }

  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 @NonNull 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 @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppIntentFilter> CREATOR;
  }

  public final class InstantAppRequestInfo implements android.os.Parcelable {
    ctor public InstantAppRequestInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, boolean, @NonNull String);
    method public int describeContents();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.InstantAppRequestInfo> CREATOR;
    field @Nullable public final int[] hostDigestPrefix;
    field @NonNull public final android.content.Intent intent;
    field public final boolean isRequesterInstantApp;
    field @NonNull public final String token;
    field @NonNull public final android.os.UserHandle userHandle;
  }

  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 @NonNull 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 @NonNull 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 @NonNull public static final android.os.Parcelable.Creator<android.content.pm.IntentFilterVerificationInfo> CREATOR;
  }

  public class LauncherApps {
    method @Nullable public android.content.pm.LauncherApps.AppUsageLimit getAppUsageLimit(@NonNull String, @NonNull android.os.UserHandle);
  }

  public static final class LauncherApps.AppUsageLimit implements android.os.Parcelable {
    method public int describeContents();
    method public long getTotalUsageLimit();
    method public long getUsageRemaining();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.LauncherApps.AppUsageLimit> CREATOR;
  }

  public static class LauncherApps.ShortcutQuery {
    method @NonNull public android.content.pm.LauncherApps.ShortcutQuery setLocusIds(@Nullable java.util.List<android.content.LocusId>);
  }

  public class PackageInstaller {
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean);
    field public static final int DATA_LOADER_TYPE_INCREMENTAL = 2; // 0x2
    field public static final int DATA_LOADER_TYPE_NONE = 0; // 0x0
    field public static final int DATA_LOADER_TYPE_STREAMING = 1; // 0x1
    field public static final String EXTRA_DATA_LOADER_TYPE = "android.content.pm.extra.DATA_LOADER_TYPE";
    field public static final int LOCATION_DATA_APP = 0; // 0x0
    field public static final int LOCATION_MEDIA_DATA = 2; // 0x2
    field public static final int LOCATION_MEDIA_OBB = 1; // 0x1
  }

  public static class PackageInstaller.Session implements java.io.Closeable {
    method public void addFile(int, @NonNull String, long, @NonNull byte[], @Nullable byte[]);
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void commitTransferred(@NonNull android.content.IntentSender);
    method @Nullable public android.content.pm.DataLoaderParams getDataLoaderParams();
    method public void removeFile(int, @NonNull String);
  }

  public static class PackageInstaller.SessionInfo implements android.os.Parcelable {
    method public boolean getAllocateAggressive();
    method @Deprecated public boolean getAllowDowngrade();
    method public boolean getDontKillApp();
    method public boolean getEnableRollback();
    method @Nullable public String[] getGrantedRuntimePermissions();
    method public boolean getInstallAsFullApp(boolean);
    method public boolean getInstallAsInstantApp(boolean);
    method public boolean getInstallAsVirtualPreload();
    method public boolean getRequestDowngrade();
    method public int getRollbackDataPolicy();
    method @NonNull public java.util.Set<java.lang.String> getWhitelistedRestrictedPermissions();
  }

  public static class PackageInstaller.SessionParams implements android.os.Parcelable {
    method @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public void setAllocateAggressive(boolean);
    method @Deprecated public void setAllowDowngrade(boolean);
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setDataLoaderParams(@NonNull android.content.pm.DataLoaderParams);
    method public void setDontKillApp(boolean);
    method public void setEnableRollback(boolean);
    method public void setEnableRollback(boolean, int);
    method @RequiresPermission(android.Manifest.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS) public void setGrantedRuntimePermissions(String[]);
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setInstallAsApex();
    method public void setInstallAsInstantApp(boolean);
    method public void setInstallAsVirtualPreload();
    method public void setRequestDowngrade(boolean);
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setStaged();
  }

  public class PackageItemInfo {
    method public static void forceSafeLabels();
    method @Deprecated @NonNull public CharSequence loadSafeLabel(@NonNull android.content.pm.PackageManager);
    method @NonNull public CharSequence loadSafeLabel(@NonNull android.content.pm.PackageManager, @FloatRange(from=0) float, int);
  }

  public abstract class PackageManager {
    method @RequiresPermission("android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS") public abstract void addOnPermissionsChangeListener(@NonNull android.content.pm.PackageManager.OnPermissionsChangedListener);
    method public abstract boolean arePermissionsIndividuallyControlled();
    method @NonNull public abstract java.util.List<android.content.IntentFilter> getAllIntentFilters(@NonNull String);
    method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.pm.ApplicationInfo getApplicationInfoAsUser(@NonNull String, int, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException;
    method @NonNull public android.content.pm.dex.ArtManager getArtManager();
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_SHARED_LIBRARIES) public java.util.List<android.content.pm.SharedLibraryInfo> getDeclaredSharedLibraries(@NonNull String, int);
    method @Nullable @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 @Nullable public String getIncidentReportApproverPackageName();
    method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public abstract java.util.List<android.content.pm.PackageInfo> getInstalledPackagesAsUser(int, int);
    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_INSTANT_APPS) public abstract android.graphics.drawable.Drawable getInstantAppIcon(String);
    method @Nullable public abstract android.content.ComponentName getInstantAppInstallerComponent();
    method @Nullable public abstract android.content.ComponentName getInstantAppResolverSettingsComponent();
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_INSTANT_APPS) public abstract java.util.List<android.content.pm.InstantAppInfo> getInstantApps();
    method @NonNull public abstract java.util.List<android.content.pm.IntentFilterVerificationInfo> getIntentFilterVerifications(@NonNull String);
    method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public abstract int getIntentVerificationStatusAsUser(@NonNull String, int);
    method @android.content.pm.PackageManager.PermissionFlags @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS, android.Manifest.permission.GET_RUNTIME_PERMISSIONS}) public abstract int getPermissionFlags(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
    method @NonNull @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] getUnsuspendablePackages(@NonNull String[]);
    method @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public abstract void grantRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
    method @Deprecated public abstract int installExistingPackage(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException;
    method @Deprecated public abstract int installExistingPackage(@NonNull String, int) throws android.content.pm.PackageManager.NameNotFoundException;
    method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceiversAsUser(@NonNull android.content.Intent, int, android.os.UserHandle);
    method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public java.util.List<android.content.pm.ResolveInfo> queryIntentActivitiesAsUser(@NonNull android.content.Intent, int, @NonNull android.os.UserHandle);
    method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public java.util.List<android.content.pm.ResolveInfo> queryIntentContentProvidersAsUser(@NonNull android.content.Intent, int, @NonNull android.os.UserHandle);
    method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public java.util.List<android.content.pm.ResolveInfo> queryIntentServicesAsUser(@NonNull android.content.Intent, int, @NonNull android.os.UserHandle);
    method public abstract void registerDexModule(@NonNull String, @Nullable android.content.pm.PackageManager.DexModuleRegisterCallback);
    method @RequiresPermission("android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS") public abstract void removeOnPermissionsChangeListener(@NonNull android.content.pm.PackageManager.OnPermissionsChangedListener);
    method public void replacePreferredActivity(@NonNull android.content.IntentFilter, int, @NonNull java.util.List<android.content.ComponentName>, @NonNull android.content.ComponentName);
    method @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) public abstract void revokeRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
    method public void sendDeviceCustomizationReadyBroadcast();
    method @RequiresPermission(allOf={android.Manifest.permission.SET_PREFERRED_APPLICATIONS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public abstract boolean setDefaultBrowserPackageNameAsUser(@Nullable String, int);
    method @NonNull @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setDistractingPackageRestrictions(@NonNull String[], int);
    method @RequiresPermission(android.Manifest.permission.SET_HARMFUL_APP_WARNINGS) public void setHarmfulAppWarning(@NonNull String, @Nullable CharSequence);
    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setPackagesSuspended(@Nullable String[], boolean, @Nullable android.os.PersistableBundle, @Nullable android.os.PersistableBundle, @Nullable String);
    method @Nullable @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setPackagesSuspended(@Nullable String[], boolean, @Nullable android.os.PersistableBundle, @Nullable android.os.PersistableBundle, @Nullable android.content.pm.SuspendDialogInfo);
    method @RequiresPermission(value=android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE, conditional=true) public void setSyntheticAppDetailsActivityEnabled(@NonNull String, boolean);
    method public void setSystemAppState(@NonNull String, int);
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public abstract void setUpdateAvailable(@NonNull String, boolean);
    method @RequiresPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS) public abstract boolean updateIntentVerificationStatusAsUser(@NonNull String, int, int);
    method @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS}) public abstract void updatePermissionFlags(@NonNull String, @NonNull 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, @NonNull 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_INCREMENTAL_DELIVERY = "android.software.incremental_delivery";
    field public static final String FEATURE_REBOOT_ESCROW = "android.hardware.reboot_escrow";
    field public static final String FEATURE_TELEPHONY_CARRIERLOCK = "android.hardware.telephony.carrierlock";
    field public static final int FLAGS_PERMISSION_RESERVED_PERMISSIONCONTROLLER = -268435456; // 0xf0000000
    field public static final int FLAG_PERMISSION_APPLY_RESTRICTION = 16384; // 0x4000
    field public static final int FLAG_PERMISSION_AUTO_REVOKED = 1048576; // 0x100000
    field public static final int FLAG_PERMISSION_AUTO_REVOKE_IF_UNUSED = 131072; // 0x20000
    field public static final int FLAG_PERMISSION_AUTO_REVOKE_USER_SET = 262144; // 0x40000
    field public static final int FLAG_PERMISSION_GRANTED_BY_DEFAULT = 32; // 0x20
    field public static final int FLAG_PERMISSION_GRANTED_BY_ROLE = 32768; // 0x8000
    field public static final int FLAG_PERMISSION_ONE_TIME = 65536; // 0x10000
    field public static final int FLAG_PERMISSION_POLICY_FIXED = 4; // 0x4
    field public static final int FLAG_PERMISSION_RESTRICTION_INSTALLER_EXEMPT = 2048; // 0x800
    field public static final int FLAG_PERMISSION_RESTRICTION_SYSTEM_EXEMPT = 4096; // 0x1000
    field public static final int FLAG_PERMISSION_RESTRICTION_UPGRADE_EXEMPT = 8192; // 0x2000
    field public static final int FLAG_PERMISSION_REVIEW_REQUIRED = 64; // 0x40
    field public static final int FLAG_PERMISSION_REVOKED_COMPAT = 8; // 0x8
    field @Deprecated 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_SENSITIVE_WHEN_DENIED = 512; // 0x200
    field public static final int FLAG_PERMISSION_USER_SENSITIVE_WHEN_GRANTED = 256; // 0x100
    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 @Deprecated 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_HIDDEN_UNTIL_INSTALLED_COMPONENTS = 536870912; // 0x20000000
    field public static final int MATCH_INSTANT = 8388608; // 0x800000
    field public static final int MODULE_APEX_NAME = 1; // 0x1
    field public static final int RESTRICTION_HIDE_FROM_SUGGESTIONS = 1; // 0x1
    field public static final int RESTRICTION_HIDE_NOTIFICATIONS = 2; // 0x2
    field public static final int RESTRICTION_NONE = 0; // 0x0
    field public static final int SYSTEM_APP_STATE_HIDDEN_UNTIL_INSTALLED_HIDDEN = 0; // 0x0
    field public static final int SYSTEM_APP_STATE_HIDDEN_UNTIL_INSTALLED_VISIBLE = 1; // 0x1
    field public static final int SYSTEM_APP_STATE_INSTALLED = 2; // 0x2
    field public static final int SYSTEM_APP_STATE_UNINSTALLED = 3; // 0x3
  }

  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, android.content.pm.PackageManager.FLAG_PERMISSION_USER_SENSITIVE_WHEN_GRANTED, android.content.pm.PackageManager.FLAG_PERMISSION_USER_SENSITIVE_WHEN_DENIED, android.content.pm.PackageManager.FLAG_PERMISSION_RESTRICTION_UPGRADE_EXEMPT, android.content.pm.PackageManager.FLAG_PERMISSION_RESTRICTION_SYSTEM_EXEMPT, android.content.pm.PackageManager.FLAG_PERMISSION_RESTRICTION_INSTALLER_EXEMPT, android.content.pm.PackageManager.FLAG_PERMISSION_APPLY_RESTRICTION, android.content.pm.PackageManager.FLAG_PERMISSION_GRANTED_BY_ROLE, android.content.pm.PackageManager.FLAG_PERMISSION_REVOKED_COMPAT, android.content.pm.PackageManager.FLAG_PERMISSION_ONE_TIME, android.content.pm.PackageManager.FLAG_PERMISSION_AUTO_REVOKE_IF_UNUSED, android.content.pm.PackageManager.FLAG_PERMISSION_AUTO_REVOKE_USER_SET, android.content.pm.PackageManager.FLAG_PERMISSION_AUTO_REVOKED}) @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 final int backgroundRequestDetailResourceId;
    field @StringRes public final int backgroundRequestResourceId;
    field @StringRes public final int requestDetailResourceId;
    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_APP_PREDICTOR = 2097152; // 0x200000
    field public static final int PROTECTION_FLAG_COMPANION = 8388608; // 0x800000
    field public static final int PROTECTION_FLAG_CONFIGURATOR = 524288; // 0x80000
    field public static final int PROTECTION_FLAG_DOCUMENTER = 262144; // 0x40000
    field public static final int PROTECTION_FLAG_INCIDENT_REPORT_APPROVER = 1048576; // 0x100000
    field public static final int PROTECTION_FLAG_OEM = 16384; // 0x4000
    field public static final int PROTECTION_FLAG_RETAIL_DEMO = 16777216; // 0x1000000
    field public static final int PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER = 65536; // 0x10000
    field public static final int PROTECTION_FLAG_TELEPHONY = 4194304; // 0x400000
    field public static final int PROTECTION_FLAG_WELLBEING = 131072; // 0x20000
    field @Nullable public final String backgroundPermission;
    field @StringRes public int requestRes;
  }

  public class ResolveInfo implements android.os.Parcelable {
    field public boolean handleAllWebDataURI;
  }

  public final class ShortcutInfo implements android.os.Parcelable {
    method @Nullable public android.app.Person[] getPersons();
  }

  public class ShortcutManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_APP_PREDICTIONS) public java.util.List<android.content.pm.ShortcutManager.ShareShortcutInfo> getShareTargets(@NonNull android.content.IntentFilter);
    method public boolean hasShareTargets(@NonNull String);
  }

  public static final class ShortcutManager.ShareShortcutInfo implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.content.pm.ShortcutInfo getShortcutInfo();
    method @NonNull public android.content.ComponentName getTargetComponent();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.ShortcutManager.ShareShortcutInfo> CREATOR;
  }

  public final class SuspendDialogInfo implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int BUTTON_ACTION_MORE_DETAILS = 0; // 0x0
    field public static final int BUTTON_ACTION_UNSUSPEND = 1; // 0x1
    field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.SuspendDialogInfo> CREATOR;
  }

  public static final class SuspendDialogInfo.Builder {
    ctor public SuspendDialogInfo.Builder();
    method @NonNull public android.content.pm.SuspendDialogInfo build();
    method @NonNull public android.content.pm.SuspendDialogInfo.Builder setIcon(@DrawableRes int);
    method @NonNull public android.content.pm.SuspendDialogInfo.Builder setMessage(@NonNull String);
    method @NonNull public android.content.pm.SuspendDialogInfo.Builder setMessage(@StringRes int);
    method @NonNull public android.content.pm.SuspendDialogInfo.Builder setNeutralButtonAction(int);
    method @NonNull public android.content.pm.SuspendDialogInfo.Builder setNeutralButtonText(@StringRes int);
    method @NonNull public android.content.pm.SuspendDialogInfo.Builder setTitle(@StringRes int);
  }

}

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 {

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

}

package android.content.rollback {

  public final class PackageRollbackInfo implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public String getPackageName();
    method @NonNull public android.content.pm.VersionedPackage getVersionRolledBackFrom();
    method @NonNull public android.content.pm.VersionedPackage getVersionRolledBackTo();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.rollback.PackageRollbackInfo> CREATOR;
  }

  public final class RollbackInfo implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.List<android.content.pm.VersionedPackage> getCausePackages();
    method public int getCommittedSessionId();
    method @NonNull public java.util.List<android.content.rollback.PackageRollbackInfo> getPackages();
    method public int getRollbackId();
    method public boolean isStaged();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.rollback.RollbackInfo> CREATOR;
  }

  public final class RollbackManager {
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_ROLLBACKS, "android.permission.TEST_MANAGE_ROLLBACKS"}) public void commitRollback(int, @NonNull java.util.List<android.content.pm.VersionedPackage>, @NonNull android.content.IntentSender);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_ROLLBACKS, "android.permission.TEST_MANAGE_ROLLBACKS"}) public java.util.List<android.content.rollback.RollbackInfo> getAvailableRollbacks();
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_ROLLBACKS, "android.permission.TEST_MANAGE_ROLLBACKS"}) public java.util.List<android.content.rollback.RollbackInfo> getRecentlyCommittedRollbacks();
    field public static final String EXTRA_STATUS = "android.content.rollback.extra.STATUS";
    field public static final String EXTRA_STATUS_MESSAGE = "android.content.rollback.extra.STATUS_MESSAGE";
    field public static final int STATUS_FAILURE = 1; // 0x1
    field public static final int STATUS_FAILURE_INSTALL = 3; // 0x3
    field public static final int STATUS_FAILURE_ROLLBACK_UNAVAILABLE = 2; // 0x2
    field public static final int STATUS_SUCCESS = 0; // 0x0
  }

}

package android.debug {

  public class AdbManager {
    method @RequiresPermission(android.Manifest.permission.MANAGE_DEBUGGING) public boolean isAdbWifiQrSupported();
    method @RequiresPermission(android.Manifest.permission.MANAGE_DEBUGGING) public boolean isAdbWifiSupported();
  }

}

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.biometrics {

  public static interface BiometricManager.Authenticators {
    field @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static final int BIOMETRIC_CONVENIENCE = 4095; // 0xfff
    field @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static final int EMPTY_SET = 0; // 0x0
  }

}

package android.hardware.camera2 {

  public abstract class CameraDevice implements java.lang.AutoCloseable {
    method @Deprecated 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 @NonNull 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 @NonNull 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 long colorSampleDuration;
    field public final int colorTemperature;
    field @Nullable public final long[] colorValueBuckets;
    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 @Nullable public android.hardware.display.BrightnessCorrection getCorrectionByCategory(int);
    method @Nullable public android.hardware.display.BrightnessCorrection getCorrectionByPackageName(@NonNull String);
    method public android.util.Pair<float[],float[]> getCurve();
    method public float getShortTermModelLowerLuxMultiplier();
    method public long getShortTermModelTimeoutMillis();
    method public float getShortTermModelUpperLuxMultiplier();
    method public boolean shouldCollectColorSamples();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.display.BrightnessConfiguration> CREATOR;
    field public static final long SHORT_TERM_TIMEOUT_UNSET = -1L; // 0xffffffffffffffffL
  }

  public static class BrightnessConfiguration.Builder {
    ctor public BrightnessConfiguration.Builder(float[], float[]);
    method @NonNull public android.hardware.display.BrightnessConfiguration.Builder addCorrectionByCategory(int, @NonNull android.hardware.display.BrightnessCorrection);
    method @NonNull public android.hardware.display.BrightnessConfiguration.Builder addCorrectionByPackageName(@NonNull String, @NonNull android.hardware.display.BrightnessCorrection);
    method @NonNull public android.hardware.display.BrightnessConfiguration build();
    method public int getMaxCorrectionsByCategory();
    method public int getMaxCorrectionsByPackageName();
    method @NonNull public android.hardware.display.BrightnessConfiguration.Builder setDescription(@Nullable String);
    method @NonNull public android.hardware.display.BrightnessConfiguration.Builder setShortTermModelLowerLuxMultiplier(@FloatRange(from=0.0f) float);
    method @NonNull public android.hardware.display.BrightnessConfiguration.Builder setShortTermModelTimeoutMillis(long);
    method @NonNull public android.hardware.display.BrightnessConfiguration.Builder setShortTermModelUpperLuxMultiplier(@FloatRange(from=0.0f) float);
    method @NonNull public android.hardware.display.BrightnessConfiguration.Builder setShouldCollectColorSamples(boolean);
  }

  public final class BrightnessCorrection implements android.os.Parcelable {
    method @FloatRange(from=0.0) public float apply(@FloatRange(from=0.0) float);
    method @NonNull public static android.hardware.display.BrightnessCorrection createScaleAndTranslateLog(float, float);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.display.BrightnessCorrection> CREATOR;
  }

  public final class ColorDisplayManager {
    method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public int getNightDisplayAutoMode();
    method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public int getTransformCapabilities();
    method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setAppSaturationLevel(@NonNull String, @IntRange(from=0, to=100) int);
    method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setNightDisplayAutoMode(int);
    method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setNightDisplayCustomEndTime(@NonNull java.time.LocalTime);
    method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setNightDisplayCustomStartTime(@NonNull java.time.LocalTime);
    method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setSaturationLevel(@IntRange(from=0, to=100) int);
    field public static final int AUTO_MODE_CUSTOM_TIME = 1; // 0x1
    field public static final int AUTO_MODE_DISABLED = 0; // 0x0
    field public static final int AUTO_MODE_TWILIGHT = 2; // 0x2
    field public static final int CAPABILITY_HARDWARE_ACCELERATION_GLOBAL = 2; // 0x2
    field public static final int CAPABILITY_HARDWARE_ACCELERATION_PER_APP = 4; // 0x4
    field public static final int CAPABILITY_NONE = 0; // 0x0
    field public static final int CAPABILITY_PROTECTED_CONTENT = 1; // 0x1
  }

  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 @Deprecated @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 @NonNull public java.util.List<android.hardware.hdmi.HdmiDeviceInfo> getConnectedDevices();
    method public int getPhysicalAddress();
    method @Nullable public android.hardware.hdmi.HdmiPlaybackClient getPlaybackClient();
    method @Nullable public android.hardware.hdmi.HdmiSwitchClient getSwitchClient();
    method @Nullable public android.hardware.hdmi.HdmiTvClient getTvClient();
    method public boolean isDeviceConnected(@NonNull android.hardware.hdmi.HdmiDeviceInfo);
    method public void powerOffDevice(@NonNull android.hardware.hdmi.HdmiDeviceInfo);
    method @RequiresPermission(android.Manifest.permission.HDMI_CEC) public void removeHotplugEventListener(android.hardware.hdmi.HdmiControlManager.HotplugEventListener);
    method public void setActiveSource(@NonNull android.hardware.hdmi.HdmiDeviceInfo);
    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
  }

  @IntDef({android.hardware.hdmi.HdmiControlManager.RESULT_SUCCESS, android.hardware.hdmi.HdmiControlManager.RESULT_TIMEOUT, android.hardware.hdmi.HdmiControlManager.RESULT_SOURCE_NOT_AVAILABLE, android.hardware.hdmi.HdmiControlManager.RESULT_TARGET_NOT_AVAILABLE, android.hardware.hdmi.HdmiControlManager.RESULT_ALREADY_IN_PROGRESS, android.hardware.hdmi.HdmiControlManager.RESULT_EXCEPTION, android.hardware.hdmi.HdmiControlManager.RESULT_INCORRECT_MODE, android.hardware.hdmi.HdmiControlManager.RESULT_COMMUNICATION_FAILED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public static @interface HdmiControlManager.ControlCallbackResult {
  }

  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 @NonNull 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 @NonNull 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 @NonNull 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 HdmiSwitchClient extends android.hardware.hdmi.HdmiClient {
    method public int getDeviceType();
    method @NonNull public java.util.List<android.hardware.hdmi.HdmiPortInfo> getPortInfo();
    method public void selectPort(int, @NonNull android.hardware.hdmi.HdmiSwitchClient.OnSelectListener);
    method public void selectPort(int, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.hdmi.HdmiSwitchClient.OnSelectListener);
  }

  public static interface HdmiSwitchClient.OnSelectListener {
    method public void onSelect(@android.hardware.hdmi.HdmiControlManager.ControlCallbackResult int);
  }

  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.lights {

  public final class Light implements android.os.Parcelable {
    method public int describeContents();
    method public int getId();
    method public int getOrdinal();
    method public int getType();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.lights.Light> CREATOR;
  }

  public final class LightState implements android.os.Parcelable {
    ctor public LightState(@ColorInt int);
    method public int describeContents();
    method @ColorInt public int getColor();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.lights.LightState> CREATOR;
  }

  public final class LightsManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public java.util.List<android.hardware.lights.Light> getLights();
    method @NonNull @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public android.hardware.lights.LightsManager.LightsSession openSession();
    field public static final int LIGHT_TYPE_MICROPHONE = 8; // 0x8
  }

  public final class LightsManager.LightsSession implements java.lang.AutoCloseable {
    method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public void close();
    method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_LIGHTS) public void setLights(@NonNull android.hardware.lights.LightsRequest);
  }

  public final class LightsRequest {
  }

  public static final class LightsRequest.Builder {
    ctor public LightsRequest.Builder();
    method @NonNull public android.hardware.lights.LightsRequest build();
    method @NonNull public android.hardware.lights.LightsRequest.Builder clearLight(@NonNull android.hardware.lights.Light);
    method @NonNull public android.hardware.lights.LightsRequest.Builder setLight(@NonNull android.hardware.lights.Light, @NonNull android.hardware.lights.LightState);
  }

}

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(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) 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 @NonNull public static final android.os.Parcelable.Creator<android.hardware.location.ContextHubInfo> CREATOR;
  }

  public class ContextHubIntentEvent {
    method @NonNull public static android.hardware.location.ContextHubIntentEvent fromIntent(@NonNull android.content.Intent);
    method @NonNull public android.hardware.location.ContextHubInfo getContextHubInfo();
    method public int getEventType();
    method public int getNanoAppAbortCode();
    method public long getNanoAppId();
    method @NonNull public android.hardware.location.NanoAppMessage getNanoAppMessage();
  }

  public final class ContextHubManager {
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.ContextHubClientCallback, @NonNull java.util.concurrent.Executor);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.ContextHubClientCallback);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.app.PendingIntent, long);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubTransaction<java.lang.Void> disableNanoApp(@NonNull android.hardware.location.ContextHubInfo, long);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubTransaction<java.lang.Void> enableNanoApp(@NonNull android.hardware.location.ContextHubInfo, long);
    method @Deprecated @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int[] findNanoAppOnHub(int, @NonNull android.hardware.location.NanoAppFilter);
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int[] getContextHubHandles();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubInfo getContextHubInfo(int);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public java.util.List<android.hardware.location.ContextHubInfo> getContextHubs();
    method @Deprecated @Nullable @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.NanoAppInstanceInfo getNanoAppInstanceInfo(int);
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int loadNanoApp(int, @NonNull android.hardware.location.NanoApp);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public android.hardware.location.ContextHubTransaction<java.lang.Void> loadNanoApp(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.NanoAppBinary);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) 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(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int sendMessage(int, int, @NonNull android.hardware.location.ContextHubMessage);
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) public int unloadNanoApp(int);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_CONTEXT_HUB}) 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);
    field public static final int EVENT_HUB_RESET = 6; // 0x6
    field public static final int EVENT_NANOAPP_ABORTED = 4; // 0x4
    field public static final int EVENT_NANOAPP_DISABLED = 3; // 0x3
    field public static final int EVENT_NANOAPP_ENABLED = 2; // 0x2
    field public static final int EVENT_NANOAPP_LOADED = 0; // 0x0
    field public static final int EVENT_NANOAPP_MESSAGE = 5; // 0x5
    field public static final int EVENT_NANOAPP_UNLOADED = 1; // 0x1
    field public static final String EXTRA_CONTEXT_HUB_INFO = "android.hardware.location.extra.CONTEXT_HUB_INFO";
    field public static final String EXTRA_EVENT_TYPE = "android.hardware.location.extra.EVENT_TYPE";
    field public static final String EXTRA_MESSAGE = "android.hardware.location.extra.MESSAGE";
    field public static final String EXTRA_NANOAPP_ABORT_CODE = "android.hardware.location.extra.NANOAPP_ABORT_CODE";
    field public static final String EXTRA_NANOAPP_ID = "android.hardware.location.extra.NANOAPP_ID";
  }

  @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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 boolean isCategoryType();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 RECOGNITION_MODE_GENERIC = 8; // 0x8
    field public static final int RECOGNITION_MODE_USER_AUTHENTICATION = 4; // 0x4
    field public static final int RECOGNITION_MODE_USER_IDENTIFICATION = 2; // 0x2
    field public static final int RECOGNITION_MODE_VOICE_TRIGGER = 1; // 0x1
    field public static final int STATUS_OK = 0; // 0x0
  }

  public static final class SoundTrigger.Keyphrase implements android.os.Parcelable {
    ctor public SoundTrigger.Keyphrase(int, int, @NonNull java.util.Locale, @NonNull String, @Nullable int[]);
    method @NonNull public static android.hardware.soundtrigger.SoundTrigger.Keyphrase readFromParcel(@NonNull android.os.Parcel);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.Keyphrase> CREATOR;
    field public final int id;
    field @NonNull public final java.util.Locale locale;
    field public final int recognitionModes;
    field @NonNull public final String text;
    field @NonNull public final int[] users;
  }

  public static final class SoundTrigger.KeyphraseSoundModel extends android.hardware.soundtrigger.SoundTrigger.SoundModel implements android.os.Parcelable {
    ctor public SoundTrigger.KeyphraseSoundModel(@NonNull java.util.UUID, @NonNull java.util.UUID, @Nullable byte[], @Nullable android.hardware.soundtrigger.SoundTrigger.Keyphrase[], int);
    ctor public SoundTrigger.KeyphraseSoundModel(@NonNull java.util.UUID, @NonNull java.util.UUID, @Nullable byte[], @Nullable android.hardware.soundtrigger.SoundTrigger.Keyphrase[]);
    method @NonNull public static android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel readFromParcel(@NonNull android.os.Parcel);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel> CREATOR;
    field @NonNull public final android.hardware.soundtrigger.SoundTrigger.Keyphrase[] keyphrases;
  }

  public static final class SoundTrigger.ModelParamRange implements android.os.Parcelable {
    method public int getEnd();
    method public int getStart();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.ModelParamRange> CREATOR;
  }

  public static final class SoundTrigger.ModuleProperties implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int AUDIO_CAPABILITY_ECHO_CANCELLATION = 1; // 0x1
    field public static final int AUDIO_CAPABILITY_NOISE_SUPPRESSION = 2; // 0x2
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.soundtrigger.SoundTrigger.ModuleProperties> CREATOR;
    field public final int audioCapabilities;
    field @NonNull public final String description;
    field public final int id;
    field @NonNull public final String implementor;
    field public final int maxBufferMs;
    field public final int maxKeyphrases;
    field public final int maxSoundModels;
    field public final int maxUsers;
    field public final int powerConsumptionMw;
    field public final int recognitionModes;
    field public final boolean returnsTriggerInEvent;
    field @NonNull public final String supportedModelArch;
    field public final boolean supportsCaptureTransition;
    field public final boolean supportsConcurrentCapture;
    field @NonNull public final java.util.UUID uuid;
    field public final int version;
  }

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

  public static class SoundTrigger.SoundModel {
    field public static final int TYPE_GENERIC_SOUND = 1; // 0x1
    field public static final int TYPE_KEYPHRASE = 0; // 0x0
    field @NonNull public final byte[] data;
    field public final int type;
    field @NonNull public final java.util.UUID uuid;
    field @NonNull public final java.util.UUID vendorUuid;
    field public final int version;
  }

}

package android.hardware.usb {

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

  public class UsbManager {
    method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public long getCurrentFunctions();
    method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_USB) public java.util.List<android.hardware.usb.UsbPort> getPorts();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public void grantPermission(android.hardware.usb.UsbDevice, String);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public void resetUsbGadget();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public void setCurrentFunctions(long);
    field @RequiresPermission(android.Manifest.permission.MANAGE_USB) public static final String ACTION_USB_PORT_CHANGED = "android.hardware.usb.action.USB_PORT_CHANGED";
    field public static final String ACTION_USB_STATE = "android.hardware.usb.action.USB_STATE";
    field public static final long FUNCTION_NCM = 1024L; // 0x400L
    field public static final long FUNCTION_NONE = 0L; // 0x0L
    field public static final long FUNCTION_RNDIS = 32L; // 0x20L
    field public static final String USB_CONFIGURED = "configured";
    field public static final String USB_CONNECTED = "connected";
    field public static final String USB_FUNCTION_NCM = "ncm";
    field public static final String USB_FUNCTION_RNDIS = "rndis";
  }

  public final class UsbPort {
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USB) public android.hardware.usb.UsbPortStatus getStatus();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public void setRoles(int, int);
  }

  public final class UsbPortStatus implements android.os.Parcelable {
    method public int describeContents();
    method public int getCurrentDataRole();
    method public int getCurrentMode();
    method public int getCurrentPowerRole();
    method public int getSupportedRoleCombinations();
    method public boolean isConnected();
    method public boolean isRoleCombinationSupported(int, int);
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.usb.UsbPortStatus> CREATOR;
    field public static final int DATA_ROLE_DEVICE = 2; // 0x2
    field public static final int DATA_ROLE_HOST = 1; // 0x1
    field public static final int DATA_ROLE_NONE = 0; // 0x0
    field public static final int MODE_AUDIO_ACCESSORY = 4; // 0x4
    field public static final int MODE_DEBUG_ACCESSORY = 8; // 0x8
    field public static final int MODE_DFP = 2; // 0x2
    field public static final int MODE_NONE = 0; // 0x0
    field public static final int MODE_UFP = 1; // 0x1
    field public static final int POWER_ROLE_NONE = 0; // 0x0
    field public static final int POWER_ROLE_SINK = 2; // 0x2
    field public static final int POWER_ROLE_SOURCE = 1; // 0x1
  }

}

package android.location {

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

  public final class GnssCapabilities {
    method public boolean hasGeofencing();
    method public boolean hasLowPowerMode();
    method public boolean hasMeasurementCorrections();
    method public boolean hasMeasurementCorrectionsExcessPathLength();
    method public boolean hasMeasurementCorrectionsLosSats();
    method public boolean hasMeasurementCorrectionsReflectingPane();
    method public boolean hasMeasurements();
    method public boolean hasNavMessages();
    method public boolean hasSatelliteBlacklist();
  }

  public final class GnssMeasurementCorrections implements android.os.Parcelable {
    method public int describeContents();
    method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
    method @FloatRange(from=0.0f, to=360.0f) public float getEnvironmentBearingDegrees();
    method @FloatRange(from=0.0f, to=180.0f) public float getEnvironmentBearingUncertaintyDegrees();
    method @FloatRange(from=0.0f) public double getHorizontalPositionUncertaintyMeters();
    method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
    method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
    method @NonNull public java.util.List<android.location.GnssSingleSatCorrection> getSingleSatelliteCorrectionList();
    method @IntRange(from=0) public long getToaGpsNanosecondsOfWeek();
    method @FloatRange(from=0.0f) public double getVerticalPositionUncertaintyMeters();
    method public boolean hasEnvironmentBearing();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssMeasurementCorrections> CREATOR;
  }

  public static final class GnssMeasurementCorrections.Builder {
    ctor public GnssMeasurementCorrections.Builder();
    method @NonNull public android.location.GnssMeasurementCorrections build();
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setEnvironmentBearingDegrees(@FloatRange(from=0.0f, to=360.0f) float);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setEnvironmentBearingUncertaintyDegrees(@FloatRange(from=0.0f, to=180.0f) float);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setHorizontalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setSingleSatelliteCorrectionList(@NonNull java.util.List<android.location.GnssSingleSatCorrection>);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setToaGpsNanosecondsOfWeek(@IntRange(from=0) long);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setVerticalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
  }

  public final class GnssReflectingPlane implements android.os.Parcelable {
    method public int describeContents();
    method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
    method @FloatRange(from=0.0f, to=360.0f) public double getAzimuthDegrees();
    method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
    method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssReflectingPlane> CREATOR;
  }

  public static final class GnssReflectingPlane.Builder {
    ctor public GnssReflectingPlane.Builder();
    method @NonNull public android.location.GnssReflectingPlane build();
    method @NonNull public android.location.GnssReflectingPlane.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
    method @NonNull public android.location.GnssReflectingPlane.Builder setAzimuthDegrees(@FloatRange(from=0.0f, to=360.0f) double);
    method @NonNull public android.location.GnssReflectingPlane.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
    method @NonNull public android.location.GnssReflectingPlane.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
  }

  public final class GnssRequest implements android.os.Parcelable {
    method public int describeContents();
    method public boolean isFullTracking();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssRequest> CREATOR;
  }

  public static final class GnssRequest.Builder {
    ctor public GnssRequest.Builder();
    ctor public GnssRequest.Builder(@NonNull android.location.GnssRequest);
    method @NonNull public android.location.GnssRequest build();
    method @NonNull public android.location.GnssRequest.Builder setFullTracking(boolean);
  }

  public final class GnssSingleSatCorrection implements android.os.Parcelable {
    method public int describeContents();
    method @FloatRange(from=0.0f, fromInclusive=false) public float getCarrierFrequencyHz();
    method public int getConstellationType();
    method @FloatRange(from=0.0f) public float getExcessPathLengthMeters();
    method @FloatRange(from=0.0f) public float getExcessPathLengthUncertaintyMeters();
    method @FloatRange(from=0.0f, to=1.0f) public float getProbabilityLineOfSight();
    method @Nullable public android.location.GnssReflectingPlane getReflectingPlane();
    method @IntRange(from=0) public int getSatelliteId();
    method public boolean hasExcessPathLength();
    method public boolean hasExcessPathLengthUncertainty();
    method public boolean hasReflectingPlane();
    method public boolean hasValidSatelliteLineOfSight();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssSingleSatCorrection> CREATOR;
  }

  public static final class GnssSingleSatCorrection.Builder {
    ctor public GnssSingleSatCorrection.Builder();
    method @NonNull public android.location.GnssSingleSatCorrection build();
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setCarrierFrequencyHz(@FloatRange(from=0.0f, fromInclusive=false) float);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setConstellationType(int);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthMeters(@FloatRange(from=0.0f) float);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthUncertaintyMeters(@FloatRange(from=0.0f) float);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setProbabilityLineOfSight(@FloatRange(from=0.0f, to=1.0f) float);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setReflectingPlane(@Nullable android.location.GnssReflectingPlane);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setSatelliteId(@IntRange(from=0) int);
  }

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

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

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

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

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

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

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

  public class Location implements android.os.Parcelable {
    method public boolean isComplete();
    method public void makeComplete();
    method public void setIsFromMockProvider(boolean);
    field @Deprecated public static final String EXTRA_NO_GPS_LOCATION = "noGPSLocation";
  }

  public class LocationManager {
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void flushGnssBatch();
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull android.location.LocationRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>);
    method @Nullable public String getExtraLocationControllerPackage();
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int getGnssBatchSize();
    method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void injectGnssMeasurementCorrections(@NonNull android.location.GnssMeasurementCorrections);
    method public boolean isExtraLocationControllerPackageEnabled();
    method public boolean isLocationEnabledForUser(@NonNull android.os.UserHandle);
    method public boolean isProviderEnabledForUser(@NonNull String, @NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@NonNull String);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean registerGnssBatchedLocationCallback(long, boolean, @NonNull android.location.BatchedLocationCallback, @Nullable android.os.Handler);
    method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.LOCATION_HARDWARE}) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.app.PendingIntent);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setExtraLocationControllerPackage(@Nullable String);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void setExtraLocationControllerPackageEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setLocationEnabledForUser(boolean, @NonNull android.os.UserHandle);
    method @Deprecated @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean setProviderEnabledForUser(@NonNull String, boolean, @NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean unregisterGnssBatchedLocationCallback(@NonNull android.location.BatchedLocationCallback);
  }

  public final class LocationRequest implements android.os.Parcelable {
    method @NonNull public static android.location.LocationRequest create();
    method @NonNull public static android.location.LocationRequest createFromDeprecatedCriteria(@NonNull android.location.Criteria, long, float, boolean);
    method @NonNull public static android.location.LocationRequest createFromDeprecatedProvider(@NonNull String, long, float, boolean);
    method public int describeContents();
    method @Deprecated public long getExpireAt();
    method public long getExpireIn();
    method public long getFastestInterval();
    method public boolean getHideFromAppOps();
    method public long getInterval();
    method public int getNumUpdates();
    method @NonNull public String getProvider();
    method public int getQuality();
    method public float getSmallestDisplacement();
    method @Nullable public android.os.WorkSource getWorkSource();
    method public boolean isLocationSettingsIgnored();
    method public boolean isLowPowerMode();
    method @Deprecated @NonNull public android.location.LocationRequest setExpireAt(long);
    method @NonNull public android.location.LocationRequest setExpireIn(long);
    method @NonNull public android.location.LocationRequest setFastestInterval(long);
    method public void setHideFromAppOps(boolean);
    method @NonNull public android.location.LocationRequest setInterval(long);
    method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public android.location.LocationRequest setLocationSettingsIgnored(boolean);
    method @NonNull public android.location.LocationRequest setLowPowerMode(boolean);
    method @NonNull public android.location.LocationRequest setNumUpdates(int);
    method @NonNull public android.location.LocationRequest setProvider(@NonNull String);
    method @NonNull public android.location.LocationRequest setQuality(int);
    method @NonNull public android.location.LocationRequest setSmallestDisplacement(float);
    method public void setWorkSource(@Nullable 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 @NonNull 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();
    method public int getSystemUsage();
    method public static boolean isSystemUsage(int);
    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
    field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int USAGE_ANNOUNCEMENT = 1003; // 0x3eb
    field @RequiresPermission(allOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.MODIFY_AUDIO_ROUTING}) public static final int USAGE_CALL_ASSISTANT = 17; // 0x11
    field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int USAGE_EMERGENCY = 1000; // 0x3e8
    field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int USAGE_SAFETY = 1001; // 0x3e9
    field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int USAGE_VEHICLE_STATUS = 1002; // 0x3ea
  }

  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);
    method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public android.media.AudioAttributes.Builder setSystemUsage(int);
  }

  public final class AudioDeviceAttributes implements android.os.Parcelable {
    ctor public AudioDeviceAttributes(@NonNull android.media.AudioDeviceInfo);
    ctor public AudioDeviceAttributes(int, int, @NonNull String);
    method public int describeContents();
    method @NonNull public String getAddress();
    method public int getRole();
    method public int getType();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.media.AudioDeviceAttributes> CREATOR;
    field public static final int ROLE_INPUT = 1; // 0x1
    field public static final int ROLE_OUTPUT = 2; // 0x2
  }

  public final class AudioDeviceInfo {
    field public static final int TYPE_REMOTE_SUBMIX = 25; // 0x19
  }

  public final class AudioFocusInfo implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.media.AudioAttributes getAttributes();
    method @NonNull public String getClientId();
    method public int getClientUid();
    method public int getFlags();
    method public int getGainRequest();
    method public int getLossReceived();
    method @NonNull public String getPackageName();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull 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 @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void addOnPreferredDeviceForStrategyChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.OnPreferredDeviceForStrategyChangedListener) throws java.lang.SecurityException;
    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 @IntRange(from=0) public int getAdditionalOutputDeviceDelay(@NonNull android.media.AudioDeviceInfo);
    method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static java.util.List<android.media.audiopolicy.AudioProductStrategy> getAudioProductStrategies();
    method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static java.util.List<android.media.audiopolicy.AudioVolumeGroup> getAudioVolumeGroups();
    method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public java.util.List<android.media.AudioDeviceAttributes> getDevicesForAttributes(@NonNull android.media.AudioAttributes);
    method @IntRange(from=0) public int getMaxAdditionalOutputDeviceDelay(@NonNull android.media.AudioDeviceInfo);
    method @IntRange(from=0) @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getMaxVolumeIndexForAttributes(@NonNull android.media.AudioAttributes);
    method @IntRange(from=0) @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getMinVolumeIndexForAttributes(@NonNull android.media.AudioAttributes);
    method @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public android.media.AudioDeviceAttributes getPreferredDeviceForStrategy(@NonNull android.media.audiopolicy.AudioProductStrategy);
    method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int[] getSupportedSystemUsages();
    method @IntRange(from=0) @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getVolumeIndexForAttributes(@NonNull android.media.AudioAttributes);
    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 public void registerVolumeGroupCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.VolumeGroupCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void removeOnPreferredDeviceForStrategyChangedListener(@NonNull android.media.AudioManager.OnPreferredDeviceForStrategyChangedListener);
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean removePreferredDeviceForStrategy(@NonNull android.media.audiopolicy.AudioProductStrategy);
    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 @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean setAdditionalOutputDeviceDelay(@NonNull android.media.AudioDeviceInfo, @IntRange(from=0) int);
    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 boolean setPreferredDeviceForStrategy(@NonNull android.media.audiopolicy.AudioProductStrategy, @NonNull android.media.AudioDeviceAttributes);
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void setSupportedSystemUsages(@NonNull int[]);
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void setVolumeIndexForAttributes(@NonNull android.media.AudioAttributes, int, int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void unregisterAudioPolicy(@NonNull android.media.audiopolicy.AudioPolicy);
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void unregisterAudioPolicyAsync(@NonNull android.media.audiopolicy.AudioPolicy);
    method public void unregisterVolumeGroupCallback(@NonNull android.media.AudioManager.VolumeGroupCallback);
    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
    field @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public static final int STREAM_ASSISTANT = 11; // 0xb
    field public static final int SUCCESS = 0; // 0x0
  }

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

  public static interface AudioManager.OnPreferredDeviceForStrategyChangedListener {
    method public void onPreferredDeviceForStrategyChanged(@NonNull android.media.audiopolicy.AudioProductStrategy, @Nullable android.media.AudioDeviceAttributes);
  }

  public abstract static class AudioManager.VolumeGroupCallback {
    ctor public AudioManager.VolumeGroupCallback();
    method public void onAudioVolumeGroupChanged(int, int);
  }

  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();
    method public boolean isActive();
    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.AudioRecordingMonitor android.media.AudioRouting android.media.MicrophoneDirection {
    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 AudioRecordingConfiguration implements android.os.Parcelable {
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int getClientUid();
  }

  public class HwAudioSource {
    method public boolean isPlaying();
    method public void start();
    method public void stop();
  }

  public static final class HwAudioSource.Builder {
    ctor public HwAudioSource.Builder();
    method @NonNull public android.media.HwAudioSource build();
    method @NonNull public android.media.HwAudioSource.Builder setAudioAttributes(@NonNull android.media.AudioAttributes);
    method @NonNull public android.media.HwAudioSource.Builder setAudioDeviceInfo(@NonNull android.media.AudioDeviceInfo);
  }

  public final class MediaRecorder.AudioSource {
    field @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_OUTPUT) public static final int ECHO_REFERENCE = 1997; // 0x7cd
    field @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_HOTWORD) public static final int HOTWORD = 1999; // 0x7cf
    field @RequiresPermission(android.Manifest.permission.CAPTURE_AUDIO_OUTPUT) 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();
  }

  public class RingtoneManager {
    method @RequiresPermission(android.Manifest.permission.WRITE_SETTINGS) public static void ensureDefaultRingtones(@NonNull android.content.Context);
  }

}

package android.media.audiofx {

  public class AudioEffect {
    ctor @RequiresPermission("android.permission.MODIFY_DEFAULT_AUDIO_EFFECTS") public AudioEffect(@NonNull java.util.UUID, @NonNull android.media.AudioDeviceAttributes);
  }

}

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
    field public static final int RULE_MATCH_USERID = 8; // 0x8
  }

  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 @NonNull public android.media.audiopolicy.AudioMixingRule.Builder allowPrivilegedPlaybackCapture(boolean);
    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 boolean removeUidDeviceAffinity(int);
    method public boolean removeUserIdDeviceAffinity(int);
    method public int setFocusDuckingBehavior(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException;
    method public void setRegistration(String);
    method public boolean setUidDeviceAffinity(int, @NonNull java.util.List<android.media.AudioDeviceInfo>);
    method public boolean setUserIdDeviceAffinity(int, @NonNull java.util.List<android.media.AudioDeviceInfo>);
    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 {
    ctor public AudioPolicy.AudioPolicyVolumeCallback();
    method public void onVolumeAdjustment(int);
  }

  public static class AudioPolicy.Builder {
    ctor public AudioPolicy.Builder(android.content.Context);
    method @NonNull public android.media.audiopolicy.AudioPolicy.Builder addMix(@NonNull android.media.audiopolicy.AudioMix) throws java.lang.IllegalArgumentException;
    method @NonNull 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 @NonNull public android.media.audiopolicy.AudioPolicy.Builder setAudioPolicyVolumeCallback(@NonNull android.media.audiopolicy.AudioPolicy.AudioPolicyVolumeCallback);
    method @NonNull public android.media.audiopolicy.AudioPolicy.Builder setIsAudioFocusPolicy(boolean);
    method @NonNull public android.media.audiopolicy.AudioPolicy.Builder setLooper(@NonNull android.os.Looper) throws java.lang.IllegalArgumentException;
  }

  public final class AudioProductStrategy implements android.os.Parcelable {
    method @NonNull public static android.media.audiopolicy.AudioProductStrategy createInvalidAudioProductStrategy(int);
    method public int describeContents();
    method @NonNull public android.media.AudioAttributes getAudioAttributes();
    method public int getId();
    method public boolean supportsAudioAttributes(@NonNull android.media.AudioAttributes);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.media.audiopolicy.AudioProductStrategy> CREATOR;
  }

  public final class AudioVolumeGroup implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.List<android.media.AudioAttributes> getAudioAttributes();
    method public int getId();
    method @NonNull public int[] getLegacyStreamTypes();
    method @NonNull public String name();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.media.audiopolicy.AudioVolumeGroup> CREATOR;
    field public static final int DEFAULT_VOLUME_GROUP = -1; // 0xffffffff
  }

}

package android.media.session {

  public final class MediaSessionManager {
    method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void addOnMediaKeyEventDispatchedListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.session.MediaSessionManager.OnMediaKeyEventDispatchedListener);
    method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void addOnMediaKeyEventSessionChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.session.MediaSessionManager.OnMediaKeyEventSessionChangedListener);
    method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void removeOnMediaKeyEventDispatchedListener(@NonNull android.media.session.MediaSessionManager.OnMediaKeyEventDispatchedListener);
    method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void removeOnMediaKeyEventSessionChangedListener(@NonNull android.media.session.MediaSessionManager.OnMediaKeyEventSessionChangedListener);
    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.OnMediaKeyEventDispatchedListener {
    method public void onMediaKeyEventDispatched(@NonNull android.view.KeyEvent, @NonNull String, @Nullable android.media.session.MediaSession.Token);
  }

  public static interface MediaSessionManager.OnMediaKeyEventSessionChangedListener {
    method public void onMediaKeyEventSessionChanged(@NonNull String, @Nullable android.media.session.MediaSession.Token);
  }

  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
    field public static final int RECOGNITION_FLAG_ENABLE_AUDIO_ECHO_CANCELLATION = 4; // 0x4
    field public static final int RECOGNITION_FLAG_ENABLE_AUDIO_NOISE_SUPPRESSION = 8; // 0x8
  }

  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 @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public android.media.soundtrigger.SoundTriggerManager.Model getModel(java.util.UUID);
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public android.hardware.soundtrigger.SoundTrigger.ModuleProperties getModuleProperties();
    method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public int getParameter(@NonNull java.util.UUID, int);
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public android.hardware.soundtrigger.SoundTrigger.ModelParamRange queryParameter(@Nullable java.util.UUID, int);
    method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public int setParameter(@Nullable java.util.UUID, int, int);
    method @RequiresPermission(android.Manifest.permission.MANAGE_SOUND_TRIGGER) public void updateModel(android.media.soundtrigger.SoundTriggerManager.Model);
  }

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

}

package android.media.tv {

  public final class DvbDeviceInfo implements android.os.Parcelable {
    ctor public DvbDeviceInfo(int, int);
    method public int describeContents();
    method @IntRange(from=0) public int getAdapterId();
    method @IntRange(from=0) public int getDeviceId();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.DvbDeviceInfo> CREATOR;
  }

  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 @NonNull 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, @NonNull android.media.tv.TvInputInfo, @NonNull android.media.tv.TvInputManager.HardwareCallback);
    method @Nullable @RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE) public android.media.tv.TvInputManager.Hardware acquireTvInputHardware(int, @NonNull android.media.tv.TvInputInfo, @NonNull android.media.tv.TvInputManager.HardwareCallback, @Nullable String, int);
    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 @NonNull @RequiresPermission("android.permission.DVB_DEVICE") public java.util.List<android.media.tv.DvbDeviceInfo> getDvbDeviceList();
    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 @Nullable @RequiresPermission("android.permission.DVB_DEVICE") public android.os.ParcelFileDescriptor openDvbDevice(@NonNull android.media.tv.DvbDeviceInfo, int);
    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);
    method public void onHdmiDeviceUpdated(@NonNull 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 @NonNull 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.media.tv.tuner {

  public class DemuxCapabilities {
    method public int getAudioFilterCount();
    method public int getDemuxCount();
    method public int getFilterCapabilities();
    method @NonNull @Size(5) public int[] getLinkCapabilities();
    method public int getPcrFilterCount();
    method public int getPesFilterCount();
    method public int getPlaybackCount();
    method public int getRecordCount();
    method public int getSectionFilterCount();
    method public long getSectionFilterLength();
    method public int getTsFilterCount();
    method public int getVideoFilterCount();
    method public boolean isTimeFilterSupported();
  }

  public class Descrambler implements java.lang.AutoCloseable {
    method public int addPid(int, int, @Nullable android.media.tv.tuner.filter.Filter);
    method public void close();
    method public int removePid(int, int, @Nullable android.media.tv.tuner.filter.Filter);
    method public int setKeyToken(@NonNull byte[]);
    field public static final int PID_TYPE_MMTP = 2; // 0x2
    field public static final int PID_TYPE_T = 1; // 0x1
  }

  public class Lnb implements java.lang.AutoCloseable {
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public void close();
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int sendDiseqcMessage(@NonNull byte[]);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int setSatellitePosition(int);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int setTone(int);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int setVoltage(int);
    field public static final int EVENT_TYPE_DISEQC_RX_OVERFLOW = 0; // 0x0
    field public static final int EVENT_TYPE_DISEQC_RX_PARITY_ERROR = 2; // 0x2
    field public static final int EVENT_TYPE_DISEQC_RX_TIMEOUT = 1; // 0x1
    field public static final int EVENT_TYPE_LNB_OVERLOAD = 3; // 0x3
    field public static final int POSITION_A = 1; // 0x1
    field public static final int POSITION_B = 2; // 0x2
    field public static final int POSITION_UNDEFINED = 0; // 0x0
    field public static final int TONE_CONTINUOUS = 1; // 0x1
    field public static final int TONE_NONE = 0; // 0x0
    field public static final int VOLTAGE_11V = 2; // 0x2
    field public static final int VOLTAGE_12V = 3; // 0x3
    field public static final int VOLTAGE_13V = 4; // 0x4
    field public static final int VOLTAGE_14V = 5; // 0x5
    field public static final int VOLTAGE_15V = 6; // 0x6
    field public static final int VOLTAGE_18V = 7; // 0x7
    field public static final int VOLTAGE_19V = 8; // 0x8
    field public static final int VOLTAGE_5V = 1; // 0x1
    field public static final int VOLTAGE_NONE = 0; // 0x0
  }

  public interface LnbCallback {
    method public void onDiseqcMessage(@NonNull byte[]);
    method public void onEvent(int);
  }

  public class Tuner implements java.lang.AutoCloseable {
    ctor @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public Tuner(@NonNull android.content.Context, @Nullable String, int);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int cancelScanning();
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int cancelTuning();
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public void clearOnTuneEventListener();
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public void clearResourceLostListener();
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public void close();
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int connectCiCam(int);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int disconnectCiCam();
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int getAvSyncHwId(@NonNull android.media.tv.tuner.filter.Filter);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public long getAvSyncTime(int);
    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.DemuxCapabilities getDemuxCapabilities(@NonNull android.content.Context);
    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public android.media.tv.tuner.frontend.FrontendInfo getFrontendInfo();
    method @Nullable public android.media.tv.tuner.frontend.FrontendStatus getFrontendStatus(@NonNull int[]);
    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_TV_DESCRAMBLER) public android.media.tv.tuner.Descrambler openDescrambler();
    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public android.media.tv.tuner.dvr.DvrPlayback openDvrPlayback(long, @NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.dvr.OnPlaybackStatusChangedListener);
    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public android.media.tv.tuner.dvr.DvrRecorder openDvrRecorder(long, @NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.dvr.OnRecordStatusChangedListener);
    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public android.media.tv.tuner.filter.Filter openFilter(int, int, long, @Nullable java.util.concurrent.Executor, @Nullable android.media.tv.tuner.filter.FilterCallback);
    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public android.media.tv.tuner.Lnb openLnb(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.LnbCallback);
    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public android.media.tv.tuner.Lnb openLnbByName(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.LnbCallback);
    method @Nullable public android.media.tv.tuner.filter.TimeFilter openTimeFilter();
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int scan(@NonNull android.media.tv.tuner.frontend.FrontendSettings, int, @NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.frontend.ScanCallback);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int setLnaEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public void setOnTuneEventListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.frontend.OnTuneEventListener);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public void setResourceLostListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.tuner.Tuner.OnResourceLostListener);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public void shareFrontendFromTuner(@NonNull android.media.tv.tuner.Tuner);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public int tune(@NonNull android.media.tv.tuner.frontend.FrontendSettings);
    method @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public void updateResourcePriority(int, int);
  }

  public static interface Tuner.OnResourceLostListener {
    method public void onResourceLost(@NonNull android.media.tv.tuner.Tuner);
  }

  public final class TunerConstants {
    field public static final int INVALID_AV_SYNC_ID = -1; // 0xffffffff
    field public static final int INVALID_FILTER_ID = -1; // 0xffffffff
    field public static final int INVALID_STREAM_ID = 65535; // 0xffff
    field public static final int INVALID_TS_PID = 65535; // 0xffff
    field public static final int RESULT_INVALID_ARGUMENT = 4; // 0x4
    field public static final int RESULT_INVALID_STATE = 3; // 0x3
    field public static final int RESULT_NOT_INITIALIZED = 2; // 0x2
    field public static final int RESULT_OUT_OF_MEMORY = 5; // 0x5
    field public static final int RESULT_SUCCESS = 0; // 0x0
    field public static final int RESULT_UNAVAILABLE = 1; // 0x1
    field public static final int RESULT_UNKNOWN_ERROR = 6; // 0x6
    field public static final int SCAN_TYPE_AUTO = 1; // 0x1
    field public static final int SCAN_TYPE_BLIND = 2; // 0x2
    field public static final int SCAN_TYPE_UNDEFINED = 0; // 0x0
  }

}

package android.media.tv.tuner.dvr {

  public class Dvr implements java.lang.AutoCloseable {
    ctor protected Dvr(int);
    method public int attachFilter(@NonNull android.media.tv.tuner.filter.Filter);
    method public void close();
    method public int configure(@NonNull android.media.tv.tuner.dvr.DvrSettings);
    method public int detachFilter(@NonNull android.media.tv.tuner.filter.Filter);
    method public int flush();
    method public void setFileDescriptor(@NonNull android.os.ParcelFileDescriptor);
    method public int start();
    method public int stop();
    field public static final int TYPE_PLAYBACK = 1; // 0x1
    field public static final int TYPE_RECORD = 0; // 0x0
  }

  public class DvrPlayback extends android.media.tv.tuner.dvr.Dvr {
    method public long read(long);
    method public long read(@NonNull byte[], long, long);
    field public static final int PLAYBACK_STATUS_ALMOST_EMPTY = 2; // 0x2
    field public static final int PLAYBACK_STATUS_ALMOST_FULL = 4; // 0x4
    field public static final int PLAYBACK_STATUS_EMPTY = 1; // 0x1
    field public static final int PLAYBACK_STATUS_FULL = 8; // 0x8
  }

  public class DvrRecorder extends android.media.tv.tuner.dvr.Dvr {
    method public long write(long);
    method public long write(@NonNull byte[], long, long);
  }

  public class DvrSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.dvr.DvrSettings.Builder builder(@NonNull android.content.Context);
    method public int getDataFormat();
    method public long getHighThreshold();
    method public long getLowThreshold();
    method public long getPacketSize();
    method public int getStatusMask();
    field public static final int DATA_FORMAT_ES = 2; // 0x2
    field public static final int DATA_FORMAT_PES = 1; // 0x1
    field public static final int DATA_FORMAT_SHV_TLV = 3; // 0x3
    field public static final int DATA_FORMAT_TS = 0; // 0x0
  }

  public static final class DvrSettings.Builder {
    ctor public DvrSettings.Builder();
    method @NonNull public android.media.tv.tuner.dvr.DvrSettings build();
    method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setDataFormat(int);
    method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setHighThreshold(long);
    method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setLowThreshold(long);
    method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setPacketSize(long);
    method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setStatusMask(int);
  }

  public interface OnPlaybackStatusChangedListener {
    method public void onPlaybackStatusChanged(int);
  }

  public interface OnRecordStatusChangedListener {
    method public void onRecordStatusChanged(int);
  }

}

package android.media.tv.tuner.filter {

  public class AlpFilterConfiguration extends android.media.tv.tuner.filter.FilterConfiguration {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.AlpFilterConfiguration.Builder builder(@NonNull android.content.Context);
    method public int getLengthType();
    method public int getPacketType();
    method public int getType();
    field public static final int LENGTH_TYPE_UNDEFINED = 0; // 0x0
    field public static final int LENGTH_TYPE_WITHOUT_ADDITIONAL_HEADER = 1; // 0x1
    field public static final int LENGTH_TYPE_WITH_ADDITIONAL_HEADER = 2; // 0x2
  }

  public static class AlpFilterConfiguration.Builder extends android.media.tv.tuner.filter.FilterConfiguration.Builder<android.media.tv.tuner.filter.AlpFilterConfiguration.Builder> {
    method @NonNull public android.media.tv.tuner.filter.AlpFilterConfiguration build();
    method @NonNull public android.media.tv.tuner.filter.AlpFilterConfiguration.Builder setLengthType(int);
    method @NonNull public android.media.tv.tuner.filter.AlpFilterConfiguration.Builder setPacketType(int);
  }

  public class AudioDescriptor {
    method public byte getAdFade();
    method public byte getAdGainCenter();
    method public byte getAdGainFront();
    method public byte getAdGainSurround();
    method public byte getAdPan();
    method public char getAdVersionTextTag();
  }

  public class AvSettings extends android.media.tv.tuner.filter.Settings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.AvSettings.Builder builder(@NonNull android.content.Context, int, boolean);
    method public boolean isPassthrough();
  }

  public static class AvSettings.Builder extends android.media.tv.tuner.filter.Settings.Builder<android.media.tv.tuner.filter.AvSettings.Builder> {
    method @NonNull public android.media.tv.tuner.filter.AvSettings build();
    method @NonNull public android.media.tv.tuner.filter.AvSettings.Builder setPassthrough(boolean);
  }

  public class DownloadEvent extends android.media.tv.tuner.filter.FilterEvent {
    method public int getDataLength();
    method public int getItemFragmentIndex();
    method public int getItemId();
    method public int getLastItemFragmentIndex();
    method public int getMpuSequenceNumber();
  }

  public class DownloadSettings extends android.media.tv.tuner.filter.Settings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.DownloadSettings.Builder builder(@NonNull android.content.Context, int);
    method public int getDownloadId();
  }

  public static class DownloadSettings.Builder extends android.media.tv.tuner.filter.Settings.Builder<android.media.tv.tuner.filter.DownloadSettings.Builder> {
    method @NonNull public android.media.tv.tuner.filter.DownloadSettings build();
    method @NonNull public android.media.tv.tuner.filter.DownloadSettings.Builder setDownloadId(int);
  }

  public class Filter implements java.lang.AutoCloseable {
    method public void close();
    method public int configure(@NonNull android.media.tv.tuner.filter.FilterConfiguration);
    method public int flush();
    method public int getId();
    method public int read(@NonNull byte[], long, long);
    method public int setDataSource(@Nullable android.media.tv.tuner.filter.Filter);
    method public int start();
    method public int stop();
    field public static final int STATUS_DATA_READY = 1; // 0x1
    field public static final int STATUS_HIGH_WATER = 4; // 0x4
    field public static final int STATUS_LOW_WATER = 2; // 0x2
    field public static final int STATUS_OVERFLOW = 8; // 0x8
    field public static final int SUBTYPE_AUDIO = 3; // 0x3
    field public static final int SUBTYPE_DOWNLOAD = 5; // 0x5
    field public static final int SUBTYPE_IP = 13; // 0xd
    field public static final int SUBTYPE_IP_PAYLOAD = 12; // 0xc
    field public static final int SUBTYPE_MMTP = 10; // 0xa
    field public static final int SUBTYPE_NTP = 11; // 0xb
    field public static final int SUBTYPE_PAYLOAD_THROUGH = 14; // 0xe
    field public static final int SUBTYPE_PCR = 8; // 0x8
    field public static final int SUBTYPE_PES = 2; // 0x2
    field public static final int SUBTYPE_PTP = 16; // 0x10
    field public static final int SUBTYPE_RECORD = 6; // 0x6
    field public static final int SUBTYPE_SECTION = 1; // 0x1
    field public static final int SUBTYPE_TEMI = 9; // 0x9
    field public static final int SUBTYPE_TLV = 15; // 0xf
    field public static final int SUBTYPE_TS = 7; // 0x7
    field public static final int SUBTYPE_UNDEFINED = 0; // 0x0
    field public static final int SUBTYPE_VIDEO = 4; // 0x4
    field public static final int TYPE_ALP = 16; // 0x10
    field public static final int TYPE_IP = 4; // 0x4
    field public static final int TYPE_MMTP = 2; // 0x2
    field public static final int TYPE_TLV = 8; // 0x8
    field public static final int TYPE_TS = 1; // 0x1
  }

  public interface FilterCallback {
    method public void onFilterEvent(@NonNull android.media.tv.tuner.filter.Filter, @NonNull android.media.tv.tuner.filter.FilterEvent[]);
    method public void onFilterStatusChanged(@NonNull android.media.tv.tuner.filter.Filter, int);
  }

  public abstract class FilterConfiguration {
    method @Nullable public android.media.tv.tuner.filter.Settings getSettings();
    method public abstract int getType();
    field public static final int PACKET_TYPE_COMPRESSED = 2; // 0x2
    field public static final int PACKET_TYPE_IPV4 = 0; // 0x0
    field public static final int PACKET_TYPE_SIGNALING = 4; // 0x4
  }

  public abstract static class FilterConfiguration.Builder<T extends android.media.tv.tuner.filter.FilterConfiguration.Builder<T>> {
    method @NonNull public T setSettings(@Nullable android.media.tv.tuner.filter.Settings);
  }

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

  public class IpFilterConfiguration extends android.media.tv.tuner.filter.FilterConfiguration {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.IpFilterConfiguration.Builder builder(@NonNull android.content.Context);
    method @NonNull @Size(min=4, max=16) public byte[] getDstIpAddress();
    method public int getDstPort();
    method @NonNull @Size(min=4, max=16) public byte[] getSrcIpAddress();
    method public int getSrcPort();
    method public int getType();
    method public boolean isPassthrough();
  }

  public static class IpFilterConfiguration.Builder extends android.media.tv.tuner.filter.FilterConfiguration.Builder<android.media.tv.tuner.filter.IpFilterConfiguration.Builder> {
    method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration build();
    method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setDstIpAddress(@NonNull byte[]);
    method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setDstPort(int);
    method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setPassthrough(boolean);
    method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setSrcIpAddress(@NonNull byte[]);
    method @NonNull public android.media.tv.tuner.filter.IpFilterConfiguration.Builder setSrcPort(int);
  }

  public class IpPayloadEvent extends android.media.tv.tuner.filter.FilterEvent {
    method public int getDataLength();
  }

  public class MediaEvent extends android.media.tv.tuner.filter.FilterEvent {
    method public long getAudioHandle();
    method public long getAvDataId();
    method public long getDataLength();
    method @Nullable public android.media.tv.tuner.filter.AudioDescriptor getExtraMetaData();
    method @Nullable public android.media.MediaCodec.LinearBlock getLinearBlock();
    method public int getMpuSequenceNumber();
    method public long getOffset();
    method public long getPts();
    method public int getStreamId();
    method public boolean isPrivateData();
    method public boolean isPtsPresent();
    method public boolean isSecureMemory();
  }

  public class MmtpFilterConfiguration extends android.media.tv.tuner.filter.FilterConfiguration {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.MmtpFilterConfiguration.Builder builder(@NonNull android.content.Context);
    method public int getMmtpPacketId();
    method public int getType();
  }

  public static class MmtpFilterConfiguration.Builder extends android.media.tv.tuner.filter.FilterConfiguration.Builder<android.media.tv.tuner.filter.MmtpFilterConfiguration.Builder> {
    method @NonNull public android.media.tv.tuner.filter.MmtpFilterConfiguration build();
    method @NonNull public android.media.tv.tuner.filter.MmtpFilterConfiguration.Builder setMmtpPacketId(int);
  }

  public class MmtpRecordEvent extends android.media.tv.tuner.filter.FilterEvent {
    method public long getDataLength();
    method public int getScHevcIndexMask();
  }

  public class PesEvent extends android.media.tv.tuner.filter.FilterEvent {
    method public int getDataLength();
    method public int getMpuSequenceNumber();
    method public int getStreamId();
  }

  public class PesSettings extends android.media.tv.tuner.filter.Settings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.PesSettings.Builder builder(@NonNull android.content.Context, int);
    method public int getStreamId();
    method public boolean isRaw();
  }

  public static class PesSettings.Builder {
    method @NonNull public android.media.tv.tuner.filter.PesSettings build();
    method @NonNull public android.media.tv.tuner.filter.PesSettings.Builder setRaw(boolean);
    method @NonNull public android.media.tv.tuner.filter.PesSettings.Builder setStreamId(int);
  }

  public class RecordSettings extends android.media.tv.tuner.filter.Settings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.RecordSettings.Builder builder(@NonNull android.content.Context, int);
    method public int getScIndexMask();
    method public int getScIndexType();
    method public int getTsIndexMask();
    field public static final int INDEX_TYPE_NONE = 0; // 0x0
    field public static final int INDEX_TYPE_SC = 1; // 0x1
    field public static final int INDEX_TYPE_SC_HEVC = 2; // 0x2
    field public static final int SC_HEVC_INDEX_AUD = 2; // 0x2
    field public static final int SC_HEVC_INDEX_SLICE_BLA_N_LP = 16; // 0x10
    field public static final int SC_HEVC_INDEX_SLICE_BLA_W_RADL = 8; // 0x8
    field public static final int SC_HEVC_INDEX_SLICE_CE_BLA_W_LP = 4; // 0x4
    field public static final int SC_HEVC_INDEX_SLICE_IDR_N_LP = 64; // 0x40
    field public static final int SC_HEVC_INDEX_SLICE_IDR_W_RADL = 32; // 0x20
    field public static final int SC_HEVC_INDEX_SLICE_TRAIL_CRA = 128; // 0x80
    field public static final int SC_HEVC_INDEX_SPS = 1; // 0x1
    field public static final int SC_INDEX_B_FRAME = 4; // 0x4
    field public static final int SC_INDEX_I_FRAME = 1; // 0x1
    field public static final int SC_INDEX_P_FRAME = 2; // 0x2
    field public static final int SC_INDEX_SEQUENCE = 8; // 0x8
    field public static final int TS_INDEX_ADAPTATION_EXTENSION_FLAG = 4096; // 0x1000
    field public static final int TS_INDEX_CHANGE_TO_EVEN_SCRAMBLED = 8; // 0x8
    field public static final int TS_INDEX_CHANGE_TO_NOT_SCRAMBLED = 4; // 0x4
    field public static final int TS_INDEX_CHANGE_TO_ODD_SCRAMBLED = 16; // 0x10
    field public static final int TS_INDEX_DISCONTINUITY_INDICATOR = 32; // 0x20
    field public static final int TS_INDEX_FIRST_PACKET = 1; // 0x1
    field public static final int TS_INDEX_OPCR_FLAG = 512; // 0x200
    field public static final int TS_INDEX_PAYLOAD_UNIT_START_INDICATOR = 2; // 0x2
    field public static final int TS_INDEX_PCR_FLAG = 256; // 0x100
    field public static final int TS_INDEX_PRIORITY_INDICATOR = 128; // 0x80
    field public static final int TS_INDEX_PRIVATE_DATA = 2048; // 0x800
    field public static final int TS_INDEX_RANDOM_ACCESS_INDICATOR = 64; // 0x40
    field public static final int TS_INDEX_SPLICING_POINT_FLAG = 1024; // 0x400
  }

  public static class RecordSettings.Builder extends android.media.tv.tuner.filter.Settings.Builder<android.media.tv.tuner.filter.RecordSettings.Builder> {
    method @NonNull public android.media.tv.tuner.filter.RecordSettings build();
    method @NonNull public android.media.tv.tuner.filter.RecordSettings.Builder setScIndexMask(int);
    method @NonNull public android.media.tv.tuner.filter.RecordSettings.Builder setScIndexType(int);
    method @NonNull public android.media.tv.tuner.filter.RecordSettings.Builder setTsIndexMask(int);
  }

  public class SectionEvent extends android.media.tv.tuner.filter.FilterEvent {
    method public int getDataLength();
    method public int getSectionNumber();
    method public int getTableId();
    method public int getVersion();
  }

  public abstract class SectionSettings extends android.media.tv.tuner.filter.Settings {
    method public boolean isCrcEnabled();
    method public boolean isRaw();
    method public boolean isRepeat();
  }

  public abstract static class SectionSettings.Builder<T extends android.media.tv.tuner.filter.SectionSettings.Builder<T>> extends android.media.tv.tuner.filter.Settings.Builder<android.media.tv.tuner.filter.SectionSettings.Builder<T>> {
    method @NonNull public T setCrcEnabled(boolean);
    method @NonNull public T setRaw(boolean);
    method @NonNull public T setRepeat(boolean);
  }

  public class SectionSettingsWithSectionBits extends android.media.tv.tuner.filter.SectionSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.SectionSettingsWithSectionBits.Builder builder(@NonNull android.content.Context, int);
    method @NonNull public byte[] getFilterBytes();
    method @NonNull public byte[] getMask();
    method @NonNull public byte[] getMode();
  }

  public static class SectionSettingsWithSectionBits.Builder extends android.media.tv.tuner.filter.SectionSettings.Builder<android.media.tv.tuner.filter.SectionSettingsWithSectionBits.Builder> {
    method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithSectionBits build();
    method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithSectionBits.Builder setFilter(@NonNull byte[]);
    method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithSectionBits.Builder setMask(@NonNull byte[]);
    method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithSectionBits.Builder setMode(@NonNull byte[]);
  }

  public class SectionSettingsWithTableInfo extends android.media.tv.tuner.filter.SectionSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.SectionSettingsWithTableInfo.Builder builder(@NonNull android.content.Context, int);
    method public int getTableId();
    method public int getVersion();
  }

  public static class SectionSettingsWithTableInfo.Builder extends android.media.tv.tuner.filter.SectionSettings.Builder<android.media.tv.tuner.filter.SectionSettingsWithTableInfo.Builder> {
    method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithTableInfo build();
    method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithTableInfo.Builder setTableId(int);
    method @NonNull public android.media.tv.tuner.filter.SectionSettingsWithTableInfo.Builder setVersion(int);
  }

  public abstract class Settings {
    method public int getType();
  }

  public abstract static class Settings.Builder<T extends android.media.tv.tuner.filter.Settings.Builder<T>> {
  }

  public class TemiEvent extends android.media.tv.tuner.filter.FilterEvent {
    method @NonNull public byte[] getDescriptorData();
    method public byte getDescriptorTag();
    method public long getPts();
  }

  public class TimeFilter implements java.lang.AutoCloseable {
    method public int clearTimestamp();
    method public void close();
    method public long getSourceTime();
    method public long getTimeStamp();
    method public int setCurrentTimestamp(long);
    field public static final long TIMESTAMP_UNAVAILABLE = -1L; // 0xffffffffffffffffL
  }

  public class TlvFilterConfiguration extends android.media.tv.tuner.filter.FilterConfiguration {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.TlvFilterConfiguration.Builder builder(@NonNull android.content.Context);
    method public int getPacketType();
    method public int getType();
    method public boolean isCompressedIpPacket();
    method public boolean isPassthrough();
  }

  public static class TlvFilterConfiguration.Builder extends android.media.tv.tuner.filter.FilterConfiguration.Builder<android.media.tv.tuner.filter.TlvFilterConfiguration.Builder> {
    method @NonNull public android.media.tv.tuner.filter.TlvFilterConfiguration build();
    method @NonNull public android.media.tv.tuner.filter.TlvFilterConfiguration.Builder setCompressedIpPacket(boolean);
    method @NonNull public android.media.tv.tuner.filter.TlvFilterConfiguration.Builder setPacketType(int);
    method @NonNull public android.media.tv.tuner.filter.TlvFilterConfiguration.Builder setPassthrough(boolean);
  }

  public class TsFilterConfiguration extends android.media.tv.tuner.filter.FilterConfiguration {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.filter.TsFilterConfiguration.Builder builder(@NonNull android.content.Context);
    method public int getTpid();
    method public int getType();
  }

  public static class TsFilterConfiguration.Builder extends android.media.tv.tuner.filter.FilterConfiguration.Builder<android.media.tv.tuner.filter.TsFilterConfiguration.Builder> {
    method @NonNull public android.media.tv.tuner.filter.TsFilterConfiguration build();
    method @NonNull public android.media.tv.tuner.filter.TsFilterConfiguration.Builder setTpid(int);
  }

  public class TsRecordEvent extends android.media.tv.tuner.filter.FilterEvent {
    method public long getDataLength();
    method public int getPacketId();
    method public int getScIndexMask();
    method public int getTsIndexMask();
  }

}

package android.media.tv.tuner.frontend {

  public class AnalogFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
    method public int getSifStandardCapability();
    method public int getSignalTypeCapability();
  }

  public class AnalogFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.AnalogFrontendSettings.Builder builder(@NonNull android.content.Context);
    method public int getSifStandard();
    method public int getSignalType();
    method public int getType();
    field public static final int SIF_AUTO = 1; // 0x1
    field public static final int SIF_BG = 2; // 0x2
    field public static final int SIF_BG_A2 = 4; // 0x4
    field public static final int SIF_BG_NICAM = 8; // 0x8
    field public static final int SIF_DK = 32; // 0x20
    field public static final int SIF_DK1_A2 = 64; // 0x40
    field public static final int SIF_DK2_A2 = 128; // 0x80
    field public static final int SIF_DK3_A2 = 256; // 0x100
    field public static final int SIF_DK_NICAM = 512; // 0x200
    field public static final int SIF_I = 16; // 0x10
    field public static final int SIF_I_NICAM = 32768; // 0x8000
    field public static final int SIF_L = 1024; // 0x400
    field public static final int SIF_L_NICAM = 65536; // 0x10000
    field public static final int SIF_L_PRIME = 131072; // 0x20000
    field public static final int SIF_M = 2048; // 0x800
    field public static final int SIF_M_A2 = 8192; // 0x2000
    field public static final int SIF_M_BTSC = 4096; // 0x1000
    field public static final int SIF_M_EIAJ = 16384; // 0x4000
    field public static final int SIF_UNDEFINED = 0; // 0x0
    field public static final int SIGNAL_TYPE_AUTO = 1; // 0x1
    field public static final int SIGNAL_TYPE_NTSC = 32; // 0x20
    field public static final int SIGNAL_TYPE_NTSC_443 = 64; // 0x40
    field public static final int SIGNAL_TYPE_PAL = 2; // 0x2
    field public static final int SIGNAL_TYPE_PAL_60 = 16; // 0x10
    field public static final int SIGNAL_TYPE_PAL_M = 4; // 0x4
    field public static final int SIGNAL_TYPE_PAL_N = 8; // 0x8
    field public static final int SIGNAL_TYPE_SECAM = 128; // 0x80
    field public static final int SIGNAL_TYPE_UNDEFINED = 0; // 0x0
  }

  public static class AnalogFrontendSettings.Builder extends android.media.tv.tuner.frontend.FrontendSettings.Builder<android.media.tv.tuner.frontend.AnalogFrontendSettings.Builder> {
    method @NonNull public android.media.tv.tuner.frontend.AnalogFrontendSettings build();
    method @NonNull public android.media.tv.tuner.frontend.AnalogFrontendSettings.Builder setSifStandard(int);
    method @NonNull public android.media.tv.tuner.frontend.AnalogFrontendSettings.Builder setSignalType(int);
  }

  public class Atsc3FrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
    method public int getBandwidthCapability();
    method public int getDemodOutputFormatCapability();
    method public int getFecCapability();
    method public int getModulationCapability();
    method public int getPlpCodeRateCapability();
    method public int getTimeInterleaveModeCapability();
  }

  public class Atsc3FrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.Atsc3FrontendSettings.Builder builder(@NonNull android.content.Context);
    method public int getBandwidth();
    method public int getDemodOutputFormat();
    method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings[] getPlpSettings();
    method public int getType();
    field public static final int BANDWIDTH_AUTO = 1; // 0x1
    field public static final int BANDWIDTH_BANDWIDTH_6MHZ = 2; // 0x2
    field public static final int BANDWIDTH_BANDWIDTH_7MHZ = 4; // 0x4
    field public static final int BANDWIDTH_BANDWIDTH_8MHZ = 8; // 0x8
    field public static final int BANDWIDTH_UNDEFINED = 0; // 0x0
    field public static final int CODERATE_10_15 = 512; // 0x200
    field public static final int CODERATE_11_15 = 1024; // 0x400
    field public static final int CODERATE_12_15 = 2048; // 0x800
    field public static final int CODERATE_13_15 = 4096; // 0x1000
    field public static final int CODERATE_2_15 = 2; // 0x2
    field public static final int CODERATE_3_15 = 4; // 0x4
    field public static final int CODERATE_4_15 = 8; // 0x8
    field public static final int CODERATE_5_15 = 16; // 0x10
    field public static final int CODERATE_6_15 = 32; // 0x20
    field public static final int CODERATE_7_15 = 64; // 0x40
    field public static final int CODERATE_8_15 = 128; // 0x80
    field public static final int CODERATE_9_15 = 256; // 0x100
    field public static final int CODERATE_AUTO = 1; // 0x1
    field public static final int CODERATE_UNDEFINED = 0; // 0x0
    field public static final int DEMOD_OUTPUT_FORMAT_ATSC3_LINKLAYER_PACKET = 1; // 0x1
    field public static final int DEMOD_OUTPUT_FORMAT_BASEBAND_PACKET = 2; // 0x2
    field public static final int DEMOD_OUTPUT_FORMAT_UNDEFINED = 0; // 0x0
    field public static final int FEC_AUTO = 1; // 0x1
    field public static final int FEC_BCH_LDPC_16K = 2; // 0x2
    field public static final int FEC_BCH_LDPC_64K = 4; // 0x4
    field public static final int FEC_CRC_LDPC_16K = 8; // 0x8
    field public static final int FEC_CRC_LDPC_64K = 16; // 0x10
    field public static final int FEC_LDPC_16K = 32; // 0x20
    field public static final int FEC_LDPC_64K = 64; // 0x40
    field public static final int FEC_UNDEFINED = 0; // 0x0
    field public static final int MODULATION_AUTO = 1; // 0x1
    field public static final int MODULATION_MOD_1024QAM = 32; // 0x20
    field public static final int MODULATION_MOD_16QAM = 4; // 0x4
    field public static final int MODULATION_MOD_256QAM = 16; // 0x10
    field public static final int MODULATION_MOD_4096QAM = 64; // 0x40
    field public static final int MODULATION_MOD_64QAM = 8; // 0x8
    field public static final int MODULATION_MOD_QPSK = 2; // 0x2
    field public static final int MODULATION_UNDEFINED = 0; // 0x0
    field public static final int TIME_INTERLEAVE_MODE_AUTO = 1; // 0x1
    field public static final int TIME_INTERLEAVE_MODE_CTI = 2; // 0x2
    field public static final int TIME_INTERLEAVE_MODE_HTI = 4; // 0x4
    field public static final int TIME_INTERLEAVE_MODE_UNDEFINED = 0; // 0x0
  }

  public static class Atsc3FrontendSettings.Builder extends android.media.tv.tuner.frontend.FrontendSettings.Builder<android.media.tv.tuner.frontend.Atsc3FrontendSettings.Builder> {
    method @NonNull public android.media.tv.tuner.frontend.Atsc3FrontendSettings build();
    method @NonNull public android.media.tv.tuner.frontend.Atsc3FrontendSettings.Builder setBandwidth(int);
    method @NonNull public android.media.tv.tuner.frontend.Atsc3FrontendSettings.Builder setDemodOutputFormat(int);
    method @NonNull public android.media.tv.tuner.frontend.Atsc3FrontendSettings.Builder setPlpSettings(@NonNull android.media.tv.tuner.frontend.Atsc3PlpSettings[]);
  }

  public class Atsc3PlpInfo {
    method public boolean getLlsFlag();
    method public int getPlpId();
  }

  public class Atsc3PlpSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder builder(@NonNull android.content.Context);
    method public int getCodeRate();
    method public int getFec();
    method public int getInterleaveMode();
    method public int getModulation();
    method public int getPlpId();
  }

  public static class Atsc3PlpSettings.Builder {
    method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings build();
    method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder setCodeRate(int);
    method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder setFec(int);
    method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder setInterleaveMode(int);
    method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder setModulation(int);
    method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpSettings.Builder setPlpId(int);
  }

  public class AtscFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
    method public int getModulationCapability();
  }

  public class AtscFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.AtscFrontendSettings.Builder builder(@NonNull android.content.Context);
    method public int getModulation();
    method public int getType();
    field public static final int MODULATION_AUTO = 1; // 0x1
    field public static final int MODULATION_MOD_16VSB = 8; // 0x8
    field public static final int MODULATION_MOD_8VSB = 4; // 0x4
    field public static final int MODULATION_UNDEFINED = 0; // 0x0
  }

  public static class AtscFrontendSettings.Builder extends android.media.tv.tuner.frontend.FrontendSettings.Builder<android.media.tv.tuner.frontend.AtscFrontendSettings.Builder> {
    method @NonNull public android.media.tv.tuner.frontend.AtscFrontendSettings build();
    method @NonNull public android.media.tv.tuner.frontend.AtscFrontendSettings.Builder setModulation(int);
  }

  public class DvbcFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
    method public int getAnnexCapability();
    method public int getFecCapability();
    method public int getModulationCapability();
  }

  public class DvbcFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder builder(@NonNull android.content.Context);
    method public int getAnnex();
    method public long getFec();
    method public int getModulation();
    method public int getOuterFec();
    method public int getSpectralInversion();
    method public int getSymbolRate();
    method public int getType();
    field public static final int ANNEX_A = 1; // 0x1
    field public static final int ANNEX_B = 2; // 0x2
    field public static final int ANNEX_C = 4; // 0x4
    field public static final int ANNEX_UNDEFINED = 0; // 0x0
    field public static final int MODULATION_AUTO = 1; // 0x1
    field public static final int MODULATION_MOD_128QAM = 16; // 0x10
    field public static final int MODULATION_MOD_16QAM = 2; // 0x2
    field public static final int MODULATION_MOD_256QAM = 32; // 0x20
    field public static final int MODULATION_MOD_32QAM = 4; // 0x4
    field public static final int MODULATION_MOD_64QAM = 8; // 0x8
    field public static final int MODULATION_UNDEFINED = 0; // 0x0
    field public static final int OUTER_FEC_OUTER_FEC_NONE = 1; // 0x1
    field public static final int OUTER_FEC_OUTER_FEC_RS = 2; // 0x2
    field public static final int OUTER_FEC_UNDEFINED = 0; // 0x0
    field public static final int SPECTRAL_INVERSION_INVERTED = 2; // 0x2
    field public static final int SPECTRAL_INVERSION_NORMAL = 1; // 0x1
    field public static final int SPECTRAL_INVERSION_UNDEFINED = 0; // 0x0
  }

  public static class DvbcFrontendSettings.Builder extends android.media.tv.tuner.frontend.FrontendSettings.Builder<android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder> {
    method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings build();
    method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setAnnex(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setFec(long);
    method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setModulation(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setOuterFec(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setSpectralInversion(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbcFrontendSettings.Builder setSymbolRate(int);
  }

  public class DvbsCodeRate {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.DvbsCodeRate.Builder builder(@NonNull android.content.Context);
    method public int getBitsPer1000Symbol();
    method public long getInnerFec();
    method public boolean isLinear();
    method public boolean isShortFrameEnabled();
  }

  public static class DvbsCodeRate.Builder {
    method @NonNull public android.media.tv.tuner.frontend.DvbsCodeRate build();
    method @NonNull public android.media.tv.tuner.frontend.DvbsCodeRate.Builder setBitsPer1000Symbol(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbsCodeRate.Builder setInnerFec(long);
    method @NonNull public android.media.tv.tuner.frontend.DvbsCodeRate.Builder setLinear(boolean);
    method @NonNull public android.media.tv.tuner.frontend.DvbsCodeRate.Builder setShortFrameEnabled(boolean);
  }

  public class DvbsFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
    method public long getInnerFecCapability();
    method public int getModulationCapability();
    method public int getStandardCapability();
  }

  public class DvbsFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder builder(@NonNull android.content.Context);
    method @Nullable public android.media.tv.tuner.frontend.DvbsCodeRate getCodeRate();
    method public int getInputStreamId();
    method public int getModulation();
    method public int getPilot();
    method public int getRolloff();
    method public int getStandard();
    method public int getSymbolRate();
    method public int getType();
    method public int getVcmMode();
    field public static final int MODULATION_AUTO = 1; // 0x1
    field public static final int MODULATION_MOD_128APSK = 2048; // 0x800
    field public static final int MODULATION_MOD_16APSK = 256; // 0x100
    field public static final int MODULATION_MOD_16PSK = 16; // 0x10
    field public static final int MODULATION_MOD_16QAM = 8; // 0x8
    field public static final int MODULATION_MOD_256APSK = 4096; // 0x1000
    field public static final int MODULATION_MOD_32APSK = 512; // 0x200
    field public static final int MODULATION_MOD_32PSK = 32; // 0x20
    field public static final int MODULATION_MOD_64APSK = 1024; // 0x400
    field public static final int MODULATION_MOD_8APSK = 128; // 0x80
    field public static final int MODULATION_MOD_8PSK = 4; // 0x4
    field public static final int MODULATION_MOD_ACM = 64; // 0x40
    field public static final int MODULATION_MOD_QPSK = 2; // 0x2
    field public static final int MODULATION_MOD_RESERVED = 8192; // 0x2000
    field public static final int MODULATION_UNDEFINED = 0; // 0x0
    field public static final int PILOT_AUTO = 3; // 0x3
    field public static final int PILOT_OFF = 2; // 0x2
    field public static final int PILOT_ON = 1; // 0x1
    field public static final int PILOT_UNDEFINED = 0; // 0x0
    field public static final int ROLLOFF_0_10 = 5; // 0x5
    field public static final int ROLLOFF_0_15 = 4; // 0x4
    field public static final int ROLLOFF_0_20 = 3; // 0x3
    field public static final int ROLLOFF_0_25 = 2; // 0x2
    field public static final int ROLLOFF_0_35 = 1; // 0x1
    field public static final int ROLLOFF_0_5 = 6; // 0x6
    field public static final int ROLLOFF_UNDEFINED = 0; // 0x0
    field public static final int STANDARD_AUTO = 1; // 0x1
    field public static final int STANDARD_S = 2; // 0x2
    field public static final int STANDARD_S2 = 4; // 0x4
    field public static final int STANDARD_S2X = 8; // 0x8
    field public static final int VCM_MODE_AUTO = 1; // 0x1
    field public static final int VCM_MODE_MANUAL = 2; // 0x2
    field public static final int VCM_MODE_UNDEFINED = 0; // 0x0
  }

  public static class DvbsFrontendSettings.Builder extends android.media.tv.tuner.frontend.FrontendSettings.Builder<android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder> {
    method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings build();
    method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setCodeRate(@Nullable android.media.tv.tuner.frontend.DvbsCodeRate);
    method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setInputStreamId(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setModulation(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setPilot(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setRolloff(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setStandard(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setSymbolRate(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setVcmMode(int);
  }

  public class DvbtFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
    method public int getBandwidthCapability();
    method public int getCodeRateCapability();
    method public int getConstellationCapability();
    method public int getGuardIntervalCapability();
    method public int getHierarchyCapability();
    method public int getTransmissionModeCapability();
    method public boolean isMisoSupported();
    method public boolean isT2Supported();
  }

  public class DvbtFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder builder(@NonNull android.content.Context);
    method public int getBandwidth();
    method public int getConstellation();
    method public int getGuardInterval();
    method public int getHierarchy();
    method public int getHpCodeRate();
    method public int getLpCodeRate();
    method public int getPlpGroupId();
    method public int getPlpId();
    method public int getPlpMode();
    method public int getStandard();
    method public int getTransmissionMode();
    method public int getType();
    method public boolean isHighPriority();
    method public boolean isMiso();
    field public static final int BANDWIDTH_10MHZ = 64; // 0x40
    field public static final int BANDWIDTH_1_7MHZ = 32; // 0x20
    field public static final int BANDWIDTH_5MHZ = 16; // 0x10
    field public static final int BANDWIDTH_6MHZ = 8; // 0x8
    field public static final int BANDWIDTH_7MHZ = 4; // 0x4
    field public static final int BANDWIDTH_8MHZ = 2; // 0x2
    field public static final int BANDWIDTH_AUTO = 1; // 0x1
    field public static final int BANDWIDTH_UNDEFINED = 0; // 0x0
    field public static final int CODERATE_1_2 = 2; // 0x2
    field public static final int CODERATE_2_3 = 4; // 0x4
    field public static final int CODERATE_3_4 = 8; // 0x8
    field public static final int CODERATE_3_5 = 64; // 0x40
    field public static final int CODERATE_4_5 = 128; // 0x80
    field public static final int CODERATE_5_6 = 16; // 0x10
    field public static final int CODERATE_6_7 = 256; // 0x100
    field public static final int CODERATE_7_8 = 32; // 0x20
    field public static final int CODERATE_8_9 = 512; // 0x200
    field public static final int CODERATE_AUTO = 1; // 0x1
    field public static final int CODERATE_UNDEFINED = 0; // 0x0
    field public static final int CONSTELLATION_AUTO = 1; // 0x1
    field public static final int CONSTELLATION_CONSTELLATION_16QAM = 4; // 0x4
    field public static final int CONSTELLATION_CONSTELLATION_256QAM = 16; // 0x10
    field public static final int CONSTELLATION_CONSTELLATION_64QAM = 8; // 0x8
    field public static final int CONSTELLATION_CONSTELLATION_QPSK = 2; // 0x2
    field public static final int CONSTELLATION_UNDEFINED = 0; // 0x0
    field public static final int GUARD_INTERVAL_AUTO = 1; // 0x1
    field public static final int GUARD_INTERVAL_INTERVAL_19_128 = 64; // 0x40
    field public static final int GUARD_INTERVAL_INTERVAL_19_256 = 128; // 0x80
    field public static final int GUARD_INTERVAL_INTERVAL_1_128 = 32; // 0x20
    field public static final int GUARD_INTERVAL_INTERVAL_1_16 = 4; // 0x4
    field public static final int GUARD_INTERVAL_INTERVAL_1_32 = 2; // 0x2
    field public static final int GUARD_INTERVAL_INTERVAL_1_4 = 16; // 0x10
    field public static final int GUARD_INTERVAL_INTERVAL_1_8 = 8; // 0x8
    field public static final int GUARD_INTERVAL_UNDEFINED = 0; // 0x0
    field public static final int HIERARCHY_1_INDEPTH = 64; // 0x40
    field public static final int HIERARCHY_1_NATIVE = 4; // 0x4
    field public static final int HIERARCHY_2_INDEPTH = 128; // 0x80
    field public static final int HIERARCHY_2_NATIVE = 8; // 0x8
    field public static final int HIERARCHY_4_INDEPTH = 256; // 0x100
    field public static final int HIERARCHY_4_NATIVE = 16; // 0x10
    field public static final int HIERARCHY_AUTO = 1; // 0x1
    field public static final int HIERARCHY_NON_INDEPTH = 32; // 0x20
    field public static final int HIERARCHY_NON_NATIVE = 2; // 0x2
    field public static final int HIERARCHY_UNDEFINED = 0; // 0x0
    field public static final int PLP_MODE_AUTO = 1; // 0x1
    field public static final int PLP_MODE_MANUAL = 2; // 0x2
    field public static final int PLP_MODE_UNDEFINED = 0; // 0x0
    field public static final int STANDARD_AUTO = 1; // 0x1
    field public static final int STANDARD_T = 2; // 0x2
    field public static final int STANDARD_T2 = 4; // 0x4
    field public static final int TRANSMISSION_MODE_16K = 32; // 0x20
    field public static final int TRANSMISSION_MODE_1K = 16; // 0x10
    field public static final int TRANSMISSION_MODE_2K = 2; // 0x2
    field public static final int TRANSMISSION_MODE_32K = 64; // 0x40
    field public static final int TRANSMISSION_MODE_4K = 8; // 0x8
    field public static final int TRANSMISSION_MODE_8K = 4; // 0x4
    field public static final int TRANSMISSION_MODE_AUTO = 1; // 0x1
    field public static final int TRANSMISSION_MODE_UNDEFINED = 0; // 0x0
  }

  public static class DvbtFrontendSettings.Builder extends android.media.tv.tuner.frontend.FrontendSettings.Builder<android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder> {
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings build();
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setBandwidth(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setConstellation(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setGuardInterval(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setHierarchy(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setHighPriority(boolean);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setHpCodeRate(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setLpCodeRate(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setMiso(boolean);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setPlpGroupId(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setPlpId(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setPlpMode(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setStandard(int);
    method @NonNull public android.media.tv.tuner.frontend.DvbtFrontendSettings.Builder setTransmissionMode(int);
  }

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

  public class FrontendInfo {
    method public int getAcquireRange();
    method public int getExclusiveGroupId();
    method @NonNull public android.util.Range<java.lang.Integer> getFrequencyRange();
    method @NonNull public android.media.tv.tuner.frontend.FrontendCapabilities getFrontendCapability();
    method public int getId();
    method @NonNull public int[] getStatusCapabilities();
    method @NonNull public android.util.Range<java.lang.Integer> getSymbolRateRange();
    method public int getType();
  }

  public abstract class FrontendSettings {
    method public int getFrequency();
    method public abstract int getType();
    field public static final long FEC_11_15 = 4194304L; // 0x400000L
    field public static final long FEC_11_20 = 8388608L; // 0x800000L
    field public static final long FEC_11_45 = 16777216L; // 0x1000000L
    field public static final long FEC_13_18 = 33554432L; // 0x2000000L
    field public static final long FEC_13_45 = 67108864L; // 0x4000000L
    field public static final long FEC_14_45 = 134217728L; // 0x8000000L
    field public static final long FEC_1_2 = 2L; // 0x2L
    field public static final long FEC_1_3 = 4L; // 0x4L
    field public static final long FEC_1_4 = 8L; // 0x8L
    field public static final long FEC_1_5 = 16L; // 0x10L
    field public static final long FEC_23_36 = 268435456L; // 0x10000000L
    field public static final long FEC_25_36 = 536870912L; // 0x20000000L
    field public static final long FEC_26_45 = 1073741824L; // 0x40000000L
    field public static final long FEC_28_45 = -2147483648L; // 0xffffffff80000000L
    field public static final long FEC_29_45 = 1L; // 0x1L
    field public static final long FEC_2_3 = 32L; // 0x20L
    field public static final long FEC_2_5 = 64L; // 0x40L
    field public static final long FEC_2_9 = 128L; // 0x80L
    field public static final long FEC_31_45 = 2L; // 0x2L
    field public static final long FEC_32_45 = 4L; // 0x4L
    field public static final long FEC_3_4 = 256L; // 0x100L
    field public static final long FEC_3_5 = 512L; // 0x200L
    field public static final long FEC_4_15 = 2048L; // 0x800L
    field public static final long FEC_4_5 = 1024L; // 0x400L
    field public static final long FEC_5_6 = 4096L; // 0x1000L
    field public static final long FEC_5_9 = 8192L; // 0x2000L
    field public static final long FEC_6_7 = 16384L; // 0x4000L
    field public static final long FEC_77_90 = 8L; // 0x8L
    field public static final long FEC_7_15 = 131072L; // 0x20000L
    field public static final long FEC_7_8 = 32768L; // 0x8000L
    field public static final long FEC_7_9 = 65536L; // 0x10000L
    field public static final long FEC_8_15 = 524288L; // 0x80000L
    field public static final long FEC_8_9 = 262144L; // 0x40000L
    field public static final long FEC_9_10 = 1048576L; // 0x100000L
    field public static final long FEC_9_20 = 2097152L; // 0x200000L
    field public static final long FEC_AUTO = 1L; // 0x1L
    field public static final long FEC_UNDEFINED = 0L; // 0x0L
    field public static final int TYPE_ANALOG = 1; // 0x1
    field public static final int TYPE_ATSC = 2; // 0x2
    field public static final int TYPE_ATSC3 = 3; // 0x3
    field public static final int TYPE_DVBC = 4; // 0x4
    field public static final int TYPE_DVBS = 5; // 0x5
    field public static final int TYPE_DVBT = 6; // 0x6
    field public static final int TYPE_ISDBS = 7; // 0x7
    field public static final int TYPE_ISDBS3 = 8; // 0x8
    field public static final int TYPE_ISDBT = 9; // 0x9
    field public static final int TYPE_UNDEFINED = 0; // 0x0
  }

  public abstract static class FrontendSettings.Builder<T extends android.media.tv.tuner.frontend.FrontendSettings.Builder<T>> {
    method @IntRange(from=1) @NonNull public T setFrequency(int);
  }

  public class FrontendStatus {
    method public int getAgc();
    method @NonNull public android.media.tv.tuner.frontend.FrontendStatus.Atsc3PlpInfo[] getAtsc3PlpInfo();
    method public int getBer();
    method public long getFec();
    method public int getFreqOffset();
    method public int getHierarchy();
    method @NonNull public boolean[] getLayerErrors();
    method public int getLnbVoltage();
    method public int getMer();
    method public int getModulation();
    method public int getPer();
    method public int getPerBer();
    method public int getPlpId();
    method public int getSignalQuality();
    method public int getSignalStrength();
    method public int getSnr();
    method public int getSpectralInversion();
    method public int getSymbolRate();
    method public boolean isDemodLocked();
    method public boolean isEwbs();
    method public boolean isLnaOn();
    method public boolean isRfLock();
    field public static final int FRONTEND_STATUS_TYPE_AGC = 14; // 0xe
    field public static final int FRONTEND_STATUS_TYPE_ATSC3_PLP_INFO = 21; // 0x15
    field public static final int FRONTEND_STATUS_TYPE_BER = 2; // 0x2
    field public static final int FRONTEND_STATUS_TYPE_DEMOD_LOCK = 0; // 0x0
    field public static final int FRONTEND_STATUS_TYPE_EWBS = 13; // 0xd
    field public static final int FRONTEND_STATUS_TYPE_FEC = 8; // 0x8
    field public static final int FRONTEND_STATUS_TYPE_FREQ_OFFSET = 18; // 0x12
    field public static final int FRONTEND_STATUS_TYPE_HIERARCHY = 19; // 0x13
    field public static final int FRONTEND_STATUS_TYPE_LAYER_ERROR = 16; // 0x10
    field public static final int FRONTEND_STATUS_TYPE_LNA = 15; // 0xf
    field public static final int FRONTEND_STATUS_TYPE_LNB_VOLTAGE = 11; // 0xb
    field public static final int FRONTEND_STATUS_TYPE_MER = 17; // 0x11
    field public static final int FRONTEND_STATUS_TYPE_MODULATION = 9; // 0x9
    field public static final int FRONTEND_STATUS_TYPE_PER = 3; // 0x3
    field public static final int FRONTEND_STATUS_TYPE_PLP_ID = 12; // 0xc
    field public static final int FRONTEND_STATUS_TYPE_PRE_BER = 4; // 0x4
    field public static final int FRONTEND_STATUS_TYPE_RF_LOCK = 20; // 0x14
    field public static final int FRONTEND_STATUS_TYPE_SIGNAL_QUALITY = 5; // 0x5
    field public static final int FRONTEND_STATUS_TYPE_SIGNAL_STRENGTH = 6; // 0x6
    field public static final int FRONTEND_STATUS_TYPE_SNR = 1; // 0x1
    field public static final int FRONTEND_STATUS_TYPE_SPECTRAL = 10; // 0xa
    field public static final int FRONTEND_STATUS_TYPE_SYMBOL_RATE = 7; // 0x7
  }

  public static class FrontendStatus.Atsc3PlpInfo {
    method public int getPlpId();
    method public int getUec();
    method public boolean isLock();
  }

  public class Isdbs3FrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
    method public int getCodeRateCapability();
    method public int getModulationCapability();
  }

  public class Isdbs3FrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder builder(@NonNull android.content.Context);
    method public int getCodeRate();
    method public int getModulation();
    method public int getRolloff();
    method public int getStreamId();
    method public int getStreamIdType();
    method public int getSymbolRate();
    method public int getType();
    field public static final int CODERATE_1_2 = 8; // 0x8
    field public static final int CODERATE_1_3 = 2; // 0x2
    field public static final int CODERATE_2_3 = 32; // 0x20
    field public static final int CODERATE_2_5 = 4; // 0x4
    field public static final int CODERATE_3_4 = 64; // 0x40
    field public static final int CODERATE_3_5 = 16; // 0x10
    field public static final int CODERATE_4_5 = 256; // 0x100
    field public static final int CODERATE_5_6 = 512; // 0x200
    field public static final int CODERATE_7_8 = 1024; // 0x400
    field public static final int CODERATE_7_9 = 128; // 0x80
    field public static final int CODERATE_9_10 = 2048; // 0x800
    field public static final int CODERATE_AUTO = 1; // 0x1
    field public static final int CODERATE_UNDEFINED = 0; // 0x0
    field public static final int MODULATION_AUTO = 1; // 0x1
    field public static final int MODULATION_MOD_16APSK = 16; // 0x10
    field public static final int MODULATION_MOD_32APSK = 32; // 0x20
    field public static final int MODULATION_MOD_8PSK = 8; // 0x8
    field public static final int MODULATION_MOD_BPSK = 2; // 0x2
    field public static final int MODULATION_MOD_QPSK = 4; // 0x4
    field public static final int MODULATION_UNDEFINED = 0; // 0x0
    field public static final int ROLLOFF_0_03 = 1; // 0x1
    field public static final int ROLLOFF_UNDEFINED = 0; // 0x0
  }

  public static class Isdbs3FrontendSettings.Builder extends android.media.tv.tuner.frontend.FrontendSettings.Builder<android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder> {
    method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings build();
    method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setCodeRate(int);
    method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setModulation(int);
    method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setRolloff(int);
    method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setStreamId(int);
    method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setStreamIdType(int);
    method @NonNull public android.media.tv.tuner.frontend.Isdbs3FrontendSettings.Builder setSymbolRate(int);
  }

  public class IsdbsFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
    method public int getCodeRateCapability();
    method public int getModulationCapability();
  }

  public class IsdbsFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder builder(@NonNull android.content.Context);
    method public int getCodeRate();
    method public int getModulation();
    method public int getRolloff();
    method public int getStreamId();
    method public int getStreamIdType();
    method public int getSymbolRate();
    method public int getType();
    field public static final int CODERATE_1_2 = 2; // 0x2
    field public static final int CODERATE_2_3 = 4; // 0x4
    field public static final int CODERATE_3_4 = 8; // 0x8
    field public static final int CODERATE_5_6 = 16; // 0x10
    field public static final int CODERATE_7_8 = 32; // 0x20
    field public static final int CODERATE_AUTO = 1; // 0x1
    field public static final int CODERATE_UNDEFINED = 0; // 0x0
    field public static final int MODULATION_AUTO = 1; // 0x1
    field public static final int MODULATION_MOD_BPSK = 2; // 0x2
    field public static final int MODULATION_MOD_QPSK = 4; // 0x4
    field public static final int MODULATION_MOD_TC8PSK = 8; // 0x8
    field public static final int MODULATION_UNDEFINED = 0; // 0x0
    field public static final int ROLLOFF_0_35 = 1; // 0x1
    field public static final int ROLLOFF_UNDEFINED = 0; // 0x0
    field public static final int STREAM_ID_TYPE_ID = 0; // 0x0
    field public static final int STREAM_ID_TYPE_RELATIVE_NUMBER = 1; // 0x1
  }

  public static class IsdbsFrontendSettings.Builder extends android.media.tv.tuner.frontend.FrontendSettings.Builder<android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder> {
    method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings build();
    method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setCodeRate(int);
    method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setModulation(int);
    method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setRolloff(int);
    method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setStreamId(int);
    method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setStreamIdType(int);
    method @NonNull public android.media.tv.tuner.frontend.IsdbsFrontendSettings.Builder setSymbolRate(int);
  }

  public class IsdbtFrontendCapabilities extends android.media.tv.tuner.frontend.FrontendCapabilities {
    method public int getBandwidthCapability();
    method public int getCodeRateCapability();
    method public int getGuardIntervalCapability();
    method public int getModeCapability();
    method public int getModulationCapability();
  }

  public class IsdbtFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder builder(@NonNull android.content.Context);
    method public int getBandwidth();
    method public int getCodeRate();
    method public int getGuardInterval();
    method public int getMode();
    method public int getModulation();
    method public int getServiceAreaId();
    method public int getType();
    field public static final int BANDWIDTH_6MHZ = 8; // 0x8
    field public static final int BANDWIDTH_7MHZ = 4; // 0x4
    field public static final int BANDWIDTH_8MHZ = 2; // 0x2
    field public static final int BANDWIDTH_AUTO = 1; // 0x1
    field public static final int BANDWIDTH_UNDEFINED = 0; // 0x0
    field public static final int MODE_1 = 2; // 0x2
    field public static final int MODE_2 = 4; // 0x4
    field public static final int MODE_3 = 8; // 0x8
    field public static final int MODE_AUTO = 1; // 0x1
    field public static final int MODE_UNDEFINED = 0; // 0x0
    field public static final int MODULATION_AUTO = 1; // 0x1
    field public static final int MODULATION_MOD_16QAM = 8; // 0x8
    field public static final int MODULATION_MOD_64QAM = 16; // 0x10
    field public static final int MODULATION_MOD_DQPSK = 2; // 0x2
    field public static final int MODULATION_MOD_QPSK = 4; // 0x4
    field public static final int MODULATION_UNDEFINED = 0; // 0x0
  }

  public static class IsdbtFrontendSettings.Builder extends android.media.tv.tuner.frontend.FrontendSettings.Builder<android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder> {
    method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings build();
    method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setBandwidth(int);
    method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setCodeRate(int);
    method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setGuardInterval(int);
    method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setMode(int);
    method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setModulation(int);
    method @NonNull public android.media.tv.tuner.frontend.IsdbtFrontendSettings.Builder setServiceAreaId(int);
  }

  public interface OnTuneEventListener {
    method public void onTuneEvent(int);
    field public static final int SIGNAL_LOCKED = 0; // 0x0
    field public static final int SIGNAL_LOST_LOCK = 2; // 0x2
    field public static final int SIGNAL_NO_SIGNAL = 1; // 0x1
  }

  public interface ScanCallback {
    method public void onAnalogSifStandard(int);
    method public void onAtsc3PlpInfos(@NonNull android.media.tv.tuner.frontend.Atsc3PlpInfo[]);
    method public void onDvbsStandard(int);
    method public void onDvbtStandard(int);
    method public void onFrequenciesReport(@NonNull int[]);
    method public void onGroupIds(@NonNull int[]);
    method public void onHierarchy(int);
    method public void onInputStreamIds(@NonNull int[]);
    method public void onLocked();
    method public void onPlpIds(@NonNull int[]);
    method public void onProgress(@IntRange(from=0, to=100) int);
    method public void onScanStopped();
    method public void onSignalType(int);
    method public void onSymbolRates(@NonNull int[]);
  }

}

package android.media.voice {

  public final class KeyphraseModelManager {
    method @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public void deleteKeyphraseSoundModel(int, @NonNull java.util.Locale);
    method @Nullable @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel getKeyphraseSoundModel(int, @NonNull java.util.Locale);
    method @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public void updateKeyphraseSoundModel(@NonNull android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel);
  }

}

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 {
    method public void logEvent(int, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void reevaluateNetwork();
    method public void useNetwork();
    field public static final int APP_REQUEST_REEVALUATION_REQUIRED = 100; // 0x64
    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 final class CaptivePortalData implements android.os.Parcelable {
    method public int describeContents();
    method public long getByteLimit();
    method public long getExpiryTimeMillis();
    method public long getRefreshTimeMillis();
    method @Nullable public android.net.Uri getUserPortalUrl();
    method @Nullable public android.net.Uri getVenueInfoUrl();
    method public boolean isCaptive();
    method public boolean isSessionExtendable();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.CaptivePortalData> CREATOR;
  }

  public static class CaptivePortalData.Builder {
    ctor public CaptivePortalData.Builder();
    ctor public CaptivePortalData.Builder(@Nullable android.net.CaptivePortalData);
    method @NonNull public android.net.CaptivePortalData build();
    method @NonNull public android.net.CaptivePortalData.Builder setBytesRemaining(long);
    method @NonNull public android.net.CaptivePortalData.Builder setCaptive(boolean);
    method @NonNull public android.net.CaptivePortalData.Builder setExpiryTime(long);
    method @NonNull public android.net.CaptivePortalData.Builder setRefreshTime(long);
    method @NonNull public android.net.CaptivePortalData.Builder setSessionExtendable(boolean);
    method @NonNull public android.net.CaptivePortalData.Builder setUserPortalUrl(@Nullable android.net.Uri);
    method @NonNull public android.net.CaptivePortalData.Builder setVenueInfoUrl(@Nullable android.net.Uri);
  }

  public class ConnectivityManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD) public android.net.SocketKeepalive createNattKeepalive(@NonNull android.net.Network, @NonNull android.os.ParcelFileDescriptor, @NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback);
    method @NonNull @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 @Deprecated @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public String getCaptivePortalServerUrl();
    method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void getLatestTetheringEntitlementResult(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityManager.OnTetheringEntitlementResultListener);
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public boolean isTetheringSupported();
    method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public int registerNetworkProvider(@NonNull android.net.NetworkProvider);
    method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void registerTetheringEventCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityManager.OnTetheringEventCallback);
    method @Deprecated public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, int, int, @NonNull android.os.Handler);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_AIRPLANE_MODE, android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void setAirplaneMode(boolean);
    method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public boolean shouldAvoidBadWifi();
    method @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public void startCaptivePortalApp(@NonNull android.net.Network, @NonNull android.os.Bundle);
    method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int, boolean, android.net.ConnectivityManager.OnStartTetheringCallback);
    method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int, boolean, android.net.ConnectivityManager.OnStartTetheringCallback, android.os.Handler);
    method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void stopTethering(int);
    method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void unregisterNetworkProvider(@NonNull android.net.NetworkProvider);
    method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void unregisterTetheringEventCallback(@NonNull android.net.ConnectivityManager.OnTetheringEventCallback);
    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 @Deprecated public static final int TETHER_ERROR_ENTITLEMENT_UNKONWN = 13; // 0xd
    field @Deprecated public static final int TETHER_ERROR_NO_ERROR = 0; // 0x0
    field @Deprecated public static final int TETHER_ERROR_PROVISION_FAILED = 11; // 0xb
    field public static final int TYPE_NONE = -1; // 0xffffffff
    field @Deprecated public static final int TYPE_WIFI_P2P = 13; // 0xd
  }

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

  @Deprecated public static interface ConnectivityManager.OnTetheringEntitlementResultListener {
    method @Deprecated public void onTetheringEntitlementResult(int);
  }

  @Deprecated public abstract static class ConnectivityManager.OnTetheringEventCallback {
    ctor @Deprecated public ConnectivityManager.OnTetheringEventCallback();
    method @Deprecated public void onUpstreamChanged(@Nullable android.net.Network);
  }

  public class EthernetManager {
    method @NonNull public android.net.EthernetManager.TetheredInterfaceRequest requestTetheredInterface(@NonNull android.net.EthernetManager.TetheredInterfaceCallback);
  }

  public static interface EthernetManager.TetheredInterfaceCallback {
    method public void onAvailable(@NonNull String);
    method public void onUnavailable();
  }

  public static class EthernetManager.TetheredInterfaceRequest {
    method public void release();
  }

  public class InvalidPacketException extends java.lang.Exception {
    ctor public InvalidPacketException(int);
    field public static final int ERROR_INVALID_IP_ADDRESS = -21; // 0xffffffeb
    field public static final int ERROR_INVALID_LENGTH = -23; // 0xffffffe9
    field public static final int ERROR_INVALID_PORT = -22; // 0xffffffea
    field public final int error;
  }

  public final class IpConfiguration implements android.os.Parcelable {
    ctor public IpConfiguration();
    ctor public IpConfiguration(@NonNull android.net.IpConfiguration);
    method public int describeContents();
    method @Nullable public android.net.ProxyInfo getHttpProxy();
    method @NonNull public android.net.IpConfiguration.IpAssignment getIpAssignment();
    method @NonNull public android.net.IpConfiguration.ProxySettings getProxySettings();
    method @Nullable public android.net.StaticIpConfiguration getStaticIpConfiguration();
    method public void setHttpProxy(@Nullable android.net.ProxyInfo);
    method public void setIpAssignment(@NonNull android.net.IpConfiguration.IpAssignment);
    method public void setProxySettings(@NonNull android.net.IpConfiguration.ProxySettings);
    method public void setStaticIpConfiguration(@Nullable android.net.StaticIpConfiguration);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.IpConfiguration> CREATOR;
  }

  public enum IpConfiguration.IpAssignment {
    enum_constant public static final android.net.IpConfiguration.IpAssignment DHCP;
    enum_constant public static final android.net.IpConfiguration.IpAssignment STATIC;
    enum_constant public static final android.net.IpConfiguration.IpAssignment UNASSIGNED;
  }

  public enum IpConfiguration.ProxySettings {
    enum_constant public static final android.net.IpConfiguration.ProxySettings NONE;
    enum_constant public static final android.net.IpConfiguration.ProxySettings PAC;
    enum_constant public static final android.net.IpConfiguration.ProxySettings STATIC;
    enum_constant public static final android.net.IpConfiguration.ProxySettings UNASSIGNED;
  }

  public final class IpPrefix implements android.os.Parcelable {
    ctor public IpPrefix(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int);
    ctor public IpPrefix(@NonNull String);
  }

  public final class IpSecManager {
    method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void applyTunnelModeTransform(@NonNull android.net.IpSecManager.IpSecTunnelInterface, int, @NonNull android.net.IpSecTransform) throws java.io.IOException;
    method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public android.net.IpSecManager.IpSecTunnelInterface createIpSecTunnelInterface(@NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull android.net.Network) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException;
  }

  public static final class IpSecManager.IpSecTunnelInterface implements java.lang.AutoCloseable {
    method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void addAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException;
    method public void close();
    method @NonNull public String getInterfaceName();
    method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void removeAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException;
  }

  public static class IpSecTransform.Builder {
    method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public android.net.IpSecTransform buildTunnelModeTransform(@NonNull java.net.InetAddress, @NonNull android.net.IpSecManager.SecurityParameterIndex) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException;
  }

  public class KeepalivePacketData {
    ctor protected KeepalivePacketData(@NonNull java.net.InetAddress, int, @NonNull java.net.InetAddress, int, @NonNull byte[]) throws android.net.InvalidPacketException;
    method @NonNull public byte[] getPacket();
    field @NonNull public final java.net.InetAddress dstAddress;
    field public final int dstPort;
    field @NonNull public final java.net.InetAddress srcAddress;
    field public final int srcPort;
  }

  public class LinkAddress implements android.os.Parcelable {
    ctor public LinkAddress(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int, int, int);
    ctor public LinkAddress(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int, int, int, long, long);
    ctor public LinkAddress(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int);
    ctor public LinkAddress(@NonNull String);
    ctor public LinkAddress(@NonNull String, int, int);
    method public long getDeprecationTime();
    method public long getExpirationTime();
    method public boolean isGlobalPreferred();
    method public boolean isIpv4();
    method public boolean isIpv6();
    method public boolean isSameAddressAs(@Nullable android.net.LinkAddress);
    field public static final long LIFETIME_PERMANENT = 9223372036854775807L; // 0x7fffffffffffffffL
    field public static final long LIFETIME_UNKNOWN = -1L; // 0xffffffffffffffffL
  }

  public final class LinkProperties implements android.os.Parcelable {
    ctor public LinkProperties(@Nullable android.net.LinkProperties);
    method public boolean addDnsServer(@NonNull java.net.InetAddress);
    method public boolean addLinkAddress(@NonNull android.net.LinkAddress);
    method public boolean addPcscfServer(@NonNull java.net.InetAddress);
    method @NonNull public java.util.List<java.net.InetAddress> getAddresses();
    method @NonNull public java.util.List<java.lang.String> getAllInterfaceNames();
    method @NonNull public java.util.List<android.net.LinkAddress> getAllLinkAddresses();
    method @NonNull public java.util.List<android.net.RouteInfo> getAllRoutes();
    method @Nullable public android.net.Uri getCaptivePortalApiUrl();
    method @Nullable public android.net.CaptivePortalData getCaptivePortalData();
    method @NonNull public java.util.List<java.net.InetAddress> getPcscfServers();
    method @Nullable public String getTcpBufferSizes();
    method @NonNull public java.util.List<java.net.InetAddress> getValidatedPrivateDnsServers();
    method public boolean hasGlobalIpv6Address();
    method public boolean hasIpv4Address();
    method public boolean hasIpv4DefaultRoute();
    method public boolean hasIpv4DnsServer();
    method public boolean hasIpv6DefaultRoute();
    method public boolean hasIpv6DnsServer();
    method public boolean isIpv4Provisioned();
    method public boolean isIpv6Provisioned();
    method public boolean isProvisioned();
    method public boolean isReachable(@NonNull java.net.InetAddress);
    method @NonNull public android.net.LinkProperties makeSensitiveFieldsParcelingCopy();
    method public boolean removeDnsServer(@NonNull java.net.InetAddress);
    method public boolean removeLinkAddress(@NonNull android.net.LinkAddress);
    method public boolean removeRoute(@NonNull android.net.RouteInfo);
    method public void setCaptivePortalApiUrl(@Nullable android.net.Uri);
    method public void setCaptivePortalData(@Nullable android.net.CaptivePortalData);
    method public void setPcscfServers(@NonNull java.util.Collection<java.net.InetAddress>);
    method public void setPrivateDnsServerName(@Nullable String);
    method public void setTcpBufferSizes(@Nullable String);
    method public void setUsePrivateDns(boolean);
    method public void setValidatedPrivateDnsServers(@NonNull java.util.Collection<java.net.InetAddress>);
  }

  public final class MatchAllNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
    ctor public MatchAllNetworkSpecifier();
    method public int describeContents();
    method public boolean satisfiedBy(android.net.NetworkSpecifier);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.MatchAllNetworkSpecifier> CREATOR;
  }

  public final class NattKeepalivePacketData extends android.net.KeepalivePacketData implements android.os.Parcelable {
    ctor public NattKeepalivePacketData(@NonNull java.net.InetAddress, int, @NonNull java.net.InetAddress, int, @NonNull byte[]) throws android.net.InvalidPacketException;
    method public int describeContents();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.NattKeepalivePacketData> CREATOR;
  }

  public class Network implements android.os.Parcelable {
    ctor public Network(@NonNull android.net.Network);
    method @NonNull public android.net.Network getPrivateDnsBypassingCopy();
    field public final int netId;
  }

  public abstract class NetworkAgent {
    ctor public NetworkAgent(@NonNull android.content.Context, @NonNull android.os.Looper, @NonNull String, @NonNull android.net.NetworkCapabilities, @NonNull android.net.LinkProperties, @NonNull android.net.NetworkScore, @NonNull android.net.NetworkAgentConfig, @Nullable android.net.NetworkProvider);
    method @Nullable public android.net.Network getNetwork();
    method public void onAddKeepalivePacketFilter(int, @NonNull android.net.KeepalivePacketData);
    method public void onAutomaticReconnectDisabled();
    method public void onBandwidthUpdateRequested();
    method public void onNetworkUnwanted();
    method public void onRemoveKeepalivePacketFilter(int);
    method public void onSaveAcceptUnvalidated(boolean);
    method public void onSignalStrengthThresholdsUpdated(@NonNull int[]);
    method public void onStartSocketKeepalive(int, int, @NonNull android.net.KeepalivePacketData);
    method public void onStopSocketKeepalive(int);
    method public void onValidationStatus(int, @Nullable String);
    method @NonNull public android.net.Network register();
    method public void sendLinkProperties(@NonNull android.net.LinkProperties);
    method public void sendNetworkCapabilities(@NonNull android.net.NetworkCapabilities);
    method public void sendNetworkScore(@NonNull android.net.NetworkScore);
    method public void sendSocketKeepaliveEvent(int, int);
    method public void setConnected();
    method @Deprecated public void setLegacyExtraInfo(@Nullable String);
    method @Deprecated public void setLegacySubtype(int, @NonNull String);
    method public void unregister();
    field public static final int VALIDATION_STATUS_NOT_VALID = 2; // 0x2
    field public static final int VALIDATION_STATUS_VALID = 1; // 0x1
    field public final int providerId;
  }

  public final class NetworkAgentConfig implements android.os.Parcelable {
    method public int describeContents();
    method public int getLegacyType();
    method @NonNull public String getLegacyTypeName();
    method @Nullable public String getSubscriberId();
    method public boolean isExplicitlySelected();
    method public boolean isNat64DetectionEnabled();
    method public boolean isPartialConnectivityAcceptable();
    method public boolean isProvisioningNotificationEnabled();
    method public boolean isUnvalidatedConnectivityAcceptable();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkAgentConfig> CREATOR;
  }

  public static class NetworkAgentConfig.Builder {
    ctor public NetworkAgentConfig.Builder();
    method @NonNull public android.net.NetworkAgentConfig build();
    method @NonNull public android.net.NetworkAgentConfig.Builder disableNat64Detection();
    method @NonNull public android.net.NetworkAgentConfig.Builder disableProvisioningNotification();
    method @NonNull public android.net.NetworkAgentConfig.Builder setExplicitlySelected(boolean);
    method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyType(int);
    method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyTypeName(@NonNull String);
    method @NonNull public android.net.NetworkAgentConfig.Builder setPartialConnectivityAcceptable(boolean);
    method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String);
    method @NonNull public android.net.NetworkAgentConfig.Builder setUnvalidatedConnectivityAcceptable(boolean);
  }

  public final class NetworkCapabilities implements android.os.Parcelable {
    method public boolean deduceRestrictedCapability();
    method @NonNull public java.util.List<java.lang.Integer> getAdministratorUids();
    method @Nullable public String getSSID();
    method @NonNull public int[] getTransportTypes();
    method public boolean satisfiedByNetworkCapabilities(@Nullable android.net.NetworkCapabilities);
    method @NonNull public android.net.NetworkCapabilities setAdministratorUids(@NonNull java.util.List<java.lang.Integer>);
    method @NonNull public android.net.NetworkCapabilities setRequestorPackageName(@NonNull String);
    method @NonNull public android.net.NetworkCapabilities setRequestorUid(int);
    method @NonNull public android.net.NetworkCapabilities setSSID(@Nullable String);
    method @NonNull public android.net.NetworkCapabilities setTransportInfo(@NonNull android.net.TransportInfo);
    field public static final int NET_CAPABILITY_OEM_PAID = 22; // 0x16
    field public static final int NET_CAPABILITY_PARTIAL_CONNECTIVITY = 24; // 0x18
  }

  public class NetworkKey implements android.os.Parcelable {
    ctor public NetworkKey(android.net.WifiKey);
    method @Nullable public static android.net.NetworkKey createFromScanResult(@NonNull android.net.wifi.ScanResult);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull 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 class NetworkPolicyManager {
    method @NonNull public android.telephony.SubscriptionPlan[] getSubscriptionPlans(int, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.OBSERVE_NETWORK_POLICY) public void registerSubscriptionCallback(@NonNull android.net.NetworkPolicyManager.SubscriptionCallback);
    method public void setSubscriptionOverride(int, int, int, long, @NonNull String);
    method public void setSubscriptionPlans(int, @NonNull android.telephony.SubscriptionPlan[], @NonNull String);
    method @RequiresPermission(android.Manifest.permission.OBSERVE_NETWORK_POLICY) public void unregisterSubscriptionCallback(@NonNull android.net.NetworkPolicyManager.SubscriptionCallback);
    field public static final int SUBSCRIPTION_OVERRIDE_CONGESTED = 2; // 0x2
    field public static final int SUBSCRIPTION_OVERRIDE_UNMETERED = 1; // 0x1
  }

  public static class NetworkPolicyManager.SubscriptionCallback {
    ctor public NetworkPolicyManager.SubscriptionCallback();
    method public void onSubscriptionOverride(int, int, int);
    method public void onSubscriptionPlansChanged(int, @NonNull android.telephony.SubscriptionPlan[]);
  }

  public class NetworkProvider {
    ctor public NetworkProvider(@NonNull android.content.Context, @NonNull android.os.Looper, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void declareNetworkRequestUnfulfillable(@NonNull android.net.NetworkRequest);
    method @Nullable public android.os.Messenger getMessenger();
    method @NonNull public String getName();
    method public int getProviderId();
    method public void onNetworkRequested(@NonNull android.net.NetworkRequest, int, int);
    method public void onRequestWithdrawn(@NonNull android.net.NetworkRequest);
    field public static final int ID_NONE = -1; // 0xffffffff
  }

  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 class NetworkRequest implements android.os.Parcelable {
    method @Nullable public String getRequestorPackageName();
    method public int getRequestorUid();
    method public boolean satisfiedBy(@Nullable android.net.NetworkCapabilities);
  }

  public static class NetworkRequest.Builder {
    method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SIGNAL_STRENGTH_WAKEUP) public android.net.NetworkRequest.Builder setSignalStrength(int);
  }

  public final class NetworkScore implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.net.NetworkScore.Metrics getEndToEndMetrics();
    method @NonNull public android.net.NetworkScore.Metrics getLinkLayerMetrics();
    method public int getRange();
    method @IntRange(from=android.net.NetworkScore.UNKNOWN_SIGNAL_STRENGTH, to=android.net.NetworkScore.MAX_SIGNAL_STRENGTH) public int getSignalStrength();
    method public boolean hasPolicy(int);
    method public boolean isExiting();
    method @NonNull public android.net.NetworkScore withExiting(boolean);
    method @NonNull public android.net.NetworkScore withSignalStrength(@IntRange(from=android.net.NetworkScore.UNKNOWN_SIGNAL_STRENGTH) int);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkScore> CREATOR;
    field public static final int MAX_SIGNAL_STRENGTH = 1000; // 0x3e8
    field public static final int MIN_SIGNAL_STRENGTH = 0; // 0x0
    field public static final int POLICY_DEFAULT_SUBSCRIPTION = 8; // 0x8
    field public static final int POLICY_IGNORE_ON_WIFI = 4; // 0x4
    field public static final int POLICY_LOCKDOWN_VPN = 1; // 0x1
    field public static final int POLICY_VPN = 2; // 0x2
    field public static final int RANGE_CLOSE = 1; // 0x1
    field public static final int RANGE_LONG = 4; // 0x4
    field public static final int RANGE_MEDIUM = 3; // 0x3
    field public static final int RANGE_SHORT = 2; // 0x2
    field public static final int RANGE_UNKNOWN = 0; // 0x0
    field public static final int UNKNOWN_SIGNAL_STRENGTH = -1; // 0xffffffff
  }

  public static class NetworkScore.Builder {
    ctor public NetworkScore.Builder();
    method @NonNull public android.net.NetworkScore.Builder addPolicy(int);
    method @NonNull public android.net.NetworkScore build();
    method @NonNull public android.net.NetworkScore.Builder clearPolicy(int);
    method @NonNull public android.net.NetworkScore.Builder setEndToEndMetrics(@NonNull android.net.NetworkScore.Metrics);
    method @NonNull public android.net.NetworkScore.Builder setExiting(boolean);
    method @NonNull public android.net.NetworkScore.Builder setLegacyScore(int);
    method @NonNull public android.net.NetworkScore.Builder setLinkLayerMetrics(@NonNull android.net.NetworkScore.Metrics);
    method @NonNull public android.net.NetworkScore.Builder setRange(int);
    method @NonNull public android.net.NetworkScore.Builder setSignalStrength(@IntRange(from=android.net.NetworkScore.UNKNOWN_SIGNAL_STRENGTH, to=android.net.NetworkScore.MAX_SIGNAL_STRENGTH) int);
  }

  public static class NetworkScore.Metrics {
    ctor public NetworkScore.Metrics(@IntRange(from=android.net.NetworkScore.Metrics.LATENCY_UNKNOWN) int, @IntRange(from=android.net.NetworkScore.Metrics.BANDWIDTH_UNKNOWN) int, @IntRange(from=android.net.NetworkScore.Metrics.BANDWIDTH_UNKNOWN) int);
    field public static final int BANDWIDTH_UNKNOWN = -1; // 0xffffffff
    field @NonNull public static final android.net.NetworkScore.Metrics EMPTY;
    field public static final int LATENCY_UNKNOWN = -1; // 0xffffffff
    field @IntRange(from=android.net.NetworkScore.Metrics.BANDWIDTH_UNKNOWN) public final int downlinkBandwidthKBps;
    field @IntRange(from=android.net.NetworkScore.Metrics.LATENCY_UNKNOWN) public final int latencyMs;
    field @IntRange(from=android.net.NetworkScore.Metrics.BANDWIDTH_UNKNOWN) public final int uplinkBandwidthKBps;
  }

  public class NetworkScoreManager {
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, android.Manifest.permission.REQUEST_NETWORK_SCORES}) public boolean clearScores() throws java.lang.SecurityException;
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, android.Manifest.permission.REQUEST_NETWORK_SCORES}) public void disableScoring() throws java.lang.SecurityException;
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, android.Manifest.permission.REQUEST_NETWORK_SCORES}) public String getActiveScorerPackage();
    method @RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES) public void registerNetworkScoreCallback(int, int, @NonNull java.util.concurrent.Executor, @NonNull android.net.NetworkScoreManager.NetworkScoreCallback) throws java.lang.SecurityException;
    method @RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES) public boolean requestScores(@NonNull java.util.Collection<android.net.NetworkKey>) throws java.lang.SecurityException;
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, android.Manifest.permission.REQUEST_NETWORK_SCORES}) public boolean setActiveScorer(String) throws java.lang.SecurityException;
    method @RequiresPermission(android.Manifest.permission.SCORE_NETWORKS) public boolean updateScores(@NonNull android.net.ScoredNetwork[]) throws java.lang.SecurityException;
    field @Deprecated 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 @Deprecated public static final String ACTION_SCORE_NETWORKS = "android.net.scoring.SCORE_NETWORKS";
    field @Deprecated public static final String EXTRA_NETWORKS_TO_SCORE = "networksToScore";
    field public static final String EXTRA_NEW_SCORER = "newScorer";
    field @Deprecated public static final String EXTRA_PACKAGE_NAME = "packageName";
    field public static final int SCORE_FILTER_CURRENT_NETWORK = 1; // 0x1
    field public static final int SCORE_FILTER_NONE = 0; // 0x0
    field public static final int SCORE_FILTER_SCAN_RESULTS = 2; // 0x2
  }

  public abstract static class NetworkScoreManager.NetworkScoreCallback {
    ctor public NetworkScoreManager.NetworkScoreCallback();
    method public abstract void onScoresInvalidated();
    method public abstract void onScoresUpdated(@NonNull java.util.Collection<android.net.ScoredNetwork>);
  }

  public abstract class NetworkSpecifier {
    method @Nullable public android.net.NetworkSpecifier redact();
    method public abstract boolean satisfiedBy(@Nullable android.net.NetworkSpecifier);
  }

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

  public final class NetworkStats implements android.os.Parcelable {
    ctor public NetworkStats(long, int);
    method @NonNull public android.net.NetworkStats add(@NonNull android.net.NetworkStats);
    method @NonNull public android.net.NetworkStats addValues(@NonNull android.net.NetworkStats.Entry);
    method public int describeContents();
    method @NonNull public android.net.NetworkStats subtract(@NonNull android.net.NetworkStats);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkStats> CREATOR;
    field public static final int DEFAULT_NETWORK_NO = 0; // 0x0
    field public static final int DEFAULT_NETWORK_YES = 1; // 0x1
    field @Nullable public static final String IFACE_ALL;
    field public static final String IFACE_VT = "vt_data0";
    field public static final int METERED_NO = 0; // 0x0
    field public static final int METERED_YES = 1; // 0x1
    field public static final int ROAMING_NO = 0; // 0x0
    field public static final int ROAMING_YES = 1; // 0x1
    field public static final int SET_DEFAULT = 0; // 0x0
    field public static final int SET_FOREGROUND = 1; // 0x1
    field public static final int TAG_NONE = 0; // 0x0
    field public static final int UID_ALL = -1; // 0xffffffff
    field public static final int UID_TETHERING = -5; // 0xfffffffb
  }

  public static class NetworkStats.Entry {
    ctor public NetworkStats.Entry(@Nullable String, int, int, int, int, int, int, long, long, long, long, long);
  }

  public final class RouteInfo implements android.os.Parcelable {
    ctor public RouteInfo(@Nullable android.net.IpPrefix, @Nullable java.net.InetAddress, @Nullable String, int);
    ctor public RouteInfo(@Nullable android.net.IpPrefix, @Nullable java.net.InetAddress, @Nullable String, int, int);
    method public int getMtu();
    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 @NonNull 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 @NonNull 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 abstract class SocketKeepalive implements java.lang.AutoCloseable {
    field public static final int SUCCESS = 0; // 0x0
  }

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

  public static final class StaticIpConfiguration.Builder {
    ctor public StaticIpConfiguration.Builder();
    method @NonNull public android.net.StaticIpConfiguration build();
    method @NonNull public android.net.StaticIpConfiguration.Builder setDnsServers(@NonNull Iterable<java.net.InetAddress>);
    method @NonNull public android.net.StaticIpConfiguration.Builder setDomains(@Nullable String);
    method @NonNull public android.net.StaticIpConfiguration.Builder setGateway(@Nullable java.net.InetAddress);
    method @NonNull public android.net.StaticIpConfiguration.Builder setIpAddress(@Nullable android.net.LinkAddress);
  }

  public final class TelephonyNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
    method public boolean satisfiedBy(android.net.NetworkSpecifier);
  }

  public final class TetheredClient implements android.os.Parcelable {
    ctor public TetheredClient(@NonNull android.net.MacAddress, @NonNull java.util.Collection<android.net.TetheredClient.AddressInfo>, int);
    method public int describeContents();
    method @NonNull public java.util.List<android.net.TetheredClient.AddressInfo> getAddresses();
    method @NonNull public android.net.MacAddress getMacAddress();
    method public int getTetheringType();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.TetheredClient> CREATOR;
  }

  public static final class TetheredClient.AddressInfo implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.net.LinkAddress getAddress();
    method @Nullable public String getHostname();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.TetheredClient.AddressInfo> CREATOR;
  }

  public class TetheringManager {
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerTetheringEventCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.TetheringEventCallback);
    method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void requestLatestTetheringEntitlementResult(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.OnTetheringEntitlementResultListener);
    method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void startTethering(@NonNull android.net.TetheringManager.TetheringRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.StartTetheringCallback);
    method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void startTethering(int, @NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.StartTetheringCallback);
    method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void stopAllTethering();
    method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public void stopTethering(int);
    method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.ACCESS_NETWORK_STATE}) public void unregisterTetheringEventCallback(@NonNull android.net.TetheringManager.TetheringEventCallback);
    field public static final String ACTION_TETHER_STATE_CHANGED = "android.net.conn.TETHER_STATE_CHANGED";
    field public static final String EXTRA_ACTIVE_LOCAL_ONLY = "android.net.extra.ACTIVE_LOCAL_ONLY";
    field public static final String EXTRA_ACTIVE_TETHER = "tetherArray";
    field public static final String EXTRA_AVAILABLE_TETHER = "availableArray";
    field public static final String EXTRA_ERRORED_TETHER = "erroredArray";
    field public static final int TETHERING_BLUETOOTH = 2; // 0x2
    field public static final int TETHERING_ETHERNET = 5; // 0x5
    field public static final int TETHERING_INVALID = -1; // 0xffffffff
    field public static final int TETHERING_NCM = 4; // 0x4
    field public static final int TETHERING_USB = 1; // 0x1
    field public static final int TETHERING_WIFI = 0; // 0x0
    field public static final int TETHERING_WIFI_P2P = 3; // 0x3
    field public static final int TETHER_ERROR_DHCPSERVER_ERROR = 12; // 0xc
    field public static final int TETHER_ERROR_DISABLE_NAT_ERROR = 9; // 0x9
    field public static final int TETHER_ERROR_ENABLE_NAT_ERROR = 8; // 0x8
    field public static final int TETHER_ERROR_ENTITLEMENT_UNKNOWN = 13; // 0xd
    field public static final int TETHER_ERROR_IFACE_CFG_ERROR = 10; // 0xa
    field public static final int TETHER_ERROR_MASTER_ERROR = 5; // 0x5
    field public static final int TETHER_ERROR_NO_ACCESS_TETHERING_PERMISSION = 15; // 0xf
    field public static final int TETHER_ERROR_NO_CHANGE_TETHERING_PERMISSION = 14; // 0xe
    field public static final int TETHER_ERROR_NO_ERROR = 0; // 0x0
    field public static final int TETHER_ERROR_PROVISION_FAILED = 11; // 0xb
    field public static final int TETHER_ERROR_SERVICE_UNAVAIL = 2; // 0x2
    field public static final int TETHER_ERROR_TETHER_IFACE_ERROR = 6; // 0x6
    field public static final int TETHER_ERROR_UNAVAIL_IFACE = 4; // 0x4
    field public static final int TETHER_ERROR_UNKNOWN_IFACE = 1; // 0x1
    field public static final int TETHER_ERROR_UNSUPPORTED = 3; // 0x3
    field public static final int TETHER_ERROR_UNTETHER_IFACE_ERROR = 7; // 0x7
  }

  public static interface TetheringManager.OnTetheringEntitlementResultListener {
    method public void onTetheringEntitlementResult(int);
  }

  public abstract static class TetheringManager.StartTetheringCallback {
    ctor public TetheringManager.StartTetheringCallback();
    method public void onTetheringFailed(int);
    method public void onTetheringStarted();
  }

  public abstract static class TetheringManager.TetheringEventCallback {
    ctor public TetheringManager.TetheringEventCallback();
    method public void onClientsChanged(@NonNull java.util.Collection<android.net.TetheredClient>);
    method public void onError(@NonNull String, int);
    method @Deprecated public void onTetherableInterfaceRegexpsChanged(@NonNull android.net.TetheringManager.TetheringInterfaceRegexps);
    method public void onTetherableInterfacesChanged(@NonNull java.util.List<java.lang.String>);
    method public void onTetheredInterfacesChanged(@NonNull java.util.List<java.lang.String>);
    method public void onTetheringSupported(boolean);
    method public void onUpstreamChanged(@Nullable android.net.Network);
  }

  @Deprecated public static class TetheringManager.TetheringInterfaceRegexps {
    ctor @Deprecated public TetheringManager.TetheringInterfaceRegexps(@NonNull String[], @NonNull String[], @NonNull String[]);
    method @Deprecated @NonNull public java.util.List<java.lang.String> getTetherableBluetoothRegexs();
    method @Deprecated @NonNull public java.util.List<java.lang.String> getTetherableUsbRegexs();
    method @Deprecated @NonNull public java.util.List<java.lang.String> getTetherableWifiRegexs();
  }

  public static class TetheringManager.TetheringRequest {
  }

  public static class TetheringManager.TetheringRequest.Builder {
    ctor public TetheringManager.TetheringRequest.Builder(int);
    method @NonNull public android.net.TetheringManager.TetheringRequest build();
    method @NonNull @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public android.net.TetheringManager.TetheringRequest.Builder setExemptFromEntitlementCheck(boolean);
    method @NonNull @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public android.net.TetheringManager.TetheringRequest.Builder setSilentProvisioning(boolean);
    method @NonNull @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public android.net.TetheringManager.TetheringRequest.Builder useStaticIpv4Addresses(@NonNull android.net.LinkAddress);
  }

  public class TrafficStats {
    method public static void setThreadStatsTagApp();
    method public static void setThreadStatsTagBackup();
    method public static void setThreadStatsTagRestore();
    field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_END = -113; // 0xffffff8f
    field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_START = -128; // 0xffffff80
    field public static final int TAG_NETWORK_STACK_RANGE_END = -257; // 0xfffffeff
    field public static final int TAG_NETWORK_STACK_RANGE_START = -768; // 0xfffffd00
    field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_END = -241; // 0xffffff0f
    field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_START = -256; // 0xffffff00
  }

  public abstract class Uri implements java.lang.Comparable<android.net.Uri> android.os.Parcelable {
    method @NonNull public String toSafeString();
  }

  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 @NonNull 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 final class ApfCapabilities implements android.os.Parcelable {
    ctor public ApfCapabilities(int, int, int);
    method public int describeContents();
    method public static boolean getApfDrop8023Frames();
    method @NonNull public static int[] getApfEtherTypeBlackList();
    method public boolean hasDataAccess();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.net.apf.ApfCapabilities> CREATOR;
    field public final int apfPacketFormat;
    field public final int apfVersionSupported;
    field public final int maximumApfProgramSize;
  }

}

package android.net.eap {

  public final class EapSessionConfig {
  }

  public static final class EapSessionConfig.Builder {
    ctor public EapSessionConfig.Builder();
    method @NonNull public android.net.eap.EapSessionConfig build();
    method @NonNull public android.net.eap.EapSessionConfig.Builder setEapAkaConfig(int, int);
    method @NonNull public android.net.eap.EapSessionConfig.Builder setEapAkaPrimeConfig(int, int, @NonNull String, boolean);
    method @NonNull public android.net.eap.EapSessionConfig.Builder setEapIdentity(@NonNull byte[]);
    method @NonNull public android.net.eap.EapSessionConfig.Builder setEapMsChapV2Config(@NonNull String, @NonNull String);
    method @NonNull public android.net.eap.EapSessionConfig.Builder setEapSimConfig(int, int);
  }

  public static class EapSessionConfig.EapAkaConfig extends android.net.eap.EapSessionConfig.EapUiccConfig {
  }

  public static class EapSessionConfig.EapAkaPrimeConfig extends android.net.eap.EapSessionConfig.EapAkaConfig {
    method public boolean allowsMismatchedNetworkNames();
    method @NonNull public String getNetworkName();
  }

  public abstract static class EapSessionConfig.EapMethodConfig {
    method public int getMethodType();
  }

  public static class EapSessionConfig.EapMsChapV2Config extends android.net.eap.EapSessionConfig.EapMethodConfig {
    method @NonNull public String getPassword();
    method @NonNull public String getUsername();
  }

  public static class EapSessionConfig.EapSimConfig extends android.net.eap.EapSessionConfig.EapUiccConfig {
  }

  public abstract static class EapSessionConfig.EapUiccConfig extends android.net.eap.EapSessionConfig.EapMethodConfig {
    method public int getAppType();
    method public int getSubId();
  }

}

package android.net.ipsec.ike {

  public final class ChildSaProposal extends android.net.ipsec.ike.SaProposal {
  }

  public static final class ChildSaProposal.Builder {
    ctor public ChildSaProposal.Builder();
    method @NonNull public android.net.ipsec.ike.ChildSaProposal.Builder addDhGroup(int);
    method @NonNull public android.net.ipsec.ike.ChildSaProposal.Builder addEncryptionAlgorithm(int, int);
    method @NonNull public android.net.ipsec.ike.ChildSaProposal.Builder addIntegrityAlgorithm(int);
    method @NonNull public android.net.ipsec.ike.ChildSaProposal build();
  }

  public interface ChildSessionCallback {
    method public void onClosed();
    method public void onClosedExceptionally(@NonNull android.net.ipsec.ike.exceptions.IkeException);
    method public void onIpSecTransformCreated(@NonNull android.net.IpSecTransform, int);
    method public void onIpSecTransformDeleted(@NonNull android.net.IpSecTransform, int);
    method public void onOpened(@NonNull android.net.ipsec.ike.ChildSessionConfiguration);
  }

  public final class ChildSessionConfiguration {
    method @NonNull public java.util.List<android.net.ipsec.ike.IkeTrafficSelector> getInboundTrafficSelectors();
    method @NonNull public java.util.List<android.net.LinkAddress> getInternalAddresses();
    method @NonNull public java.util.List<java.net.InetAddress> getInternalDhcpServers();
    method @NonNull public java.util.List<java.net.InetAddress> getInternalDnsServers();
    method @NonNull public java.util.List<android.net.IpPrefix> getInternalSubnets();
    method @NonNull public java.util.List<android.net.ipsec.ike.IkeTrafficSelector> getOutboundTrafficSelectors();
  }

  public abstract class ChildSessionParams {
    method public long getHardLifetime();
    method @NonNull public java.util.List<android.net.ipsec.ike.IkeTrafficSelector> getLocalTrafficSelectors();
    method @NonNull public java.util.List<android.net.ipsec.ike.IkeTrafficSelector> getRemoteTrafficSelectors();
    method @NonNull public java.util.List<android.net.ipsec.ike.ChildSaProposal> getSaProposals();
    method public long getSoftLifetime();
  }

  public class IkeFqdnIdentification extends android.net.ipsec.ike.IkeIdentification {
    ctor public IkeFqdnIdentification(@NonNull String);
    field @NonNull public final String fqdn;
  }

  public abstract class IkeIdentification {
  }

  public final class IkeIpv4AddrIdentification extends android.net.ipsec.ike.IkeIdentification {
    ctor public IkeIpv4AddrIdentification(@NonNull java.net.Inet4Address);
    field @NonNull public final java.net.Inet4Address ipv4Address;
  }

  public class IkeIpv6AddrIdentification extends android.net.ipsec.ike.IkeIdentification {
    ctor public IkeIpv6AddrIdentification(@NonNull java.net.Inet6Address);
    field @NonNull public final java.net.Inet6Address ipv6Address;
  }

  public final class IkeKeyIdIdentification extends android.net.ipsec.ike.IkeIdentification {
    ctor public IkeKeyIdIdentification(@NonNull byte[]);
    field @NonNull public final byte[] keyId;
  }

  public final class IkeRfc822AddrIdentification extends android.net.ipsec.ike.IkeIdentification {
    ctor public IkeRfc822AddrIdentification(@NonNull String);
    field @NonNull public final String rfc822Name;
  }

  public final class IkeSaProposal extends android.net.ipsec.ike.SaProposal {
    method @NonNull public java.util.List<java.lang.Integer> getPseudorandomFunctions();
  }

  public static final class IkeSaProposal.Builder {
    ctor public IkeSaProposal.Builder();
    method @NonNull public android.net.ipsec.ike.IkeSaProposal.Builder addDhGroup(int);
    method @NonNull public android.net.ipsec.ike.IkeSaProposal.Builder addEncryptionAlgorithm(int, int);
    method @NonNull public android.net.ipsec.ike.IkeSaProposal.Builder addIntegrityAlgorithm(int);
    method @NonNull public android.net.ipsec.ike.IkeSaProposal.Builder addPseudorandomFunction(int);
    method @NonNull public android.net.ipsec.ike.IkeSaProposal build();
  }

  public final class IkeSession implements java.lang.AutoCloseable {
    ctor public IkeSession(@NonNull android.content.Context, @NonNull android.net.ipsec.ike.IkeSessionParams, @NonNull android.net.ipsec.ike.ChildSessionParams, @NonNull java.util.concurrent.Executor, @NonNull android.net.ipsec.ike.IkeSessionCallback, @NonNull android.net.ipsec.ike.ChildSessionCallback);
    method public void close();
    method public void closeChildSession(@NonNull android.net.ipsec.ike.ChildSessionCallback);
    method public void kill();
    method public void openChildSession(@NonNull android.net.ipsec.ike.ChildSessionParams, @NonNull android.net.ipsec.ike.ChildSessionCallback);
  }

  public interface IkeSessionCallback {
    method public void onClosed();
    method public void onClosedExceptionally(@NonNull android.net.ipsec.ike.exceptions.IkeException);
    method public void onError(@NonNull android.net.ipsec.ike.exceptions.IkeProtocolException);
    method public void onOpened(@NonNull android.net.ipsec.ike.IkeSessionConfiguration);
  }

  public final class IkeSessionConfiguration {
    method @NonNull public java.util.List<java.net.InetAddress> getPcscfServers();
    method @NonNull public String getRemoteApplicationVersion();
    method @NonNull public java.util.List<byte[]> getRemoteVendorIDs();
    method public boolean isIkeExtensionEnabled(int);
    field public static final int EXTENSION_TYPE_FRAGMENTATION = 1; // 0x1
    field public static final int EXTENSION_TYPE_MOBIKE = 2; // 0x2
  }

  public final class IkeSessionParams {
    method @NonNull public java.util.List<android.net.ipsec.ike.IkeSessionParams.IkeConfigRequest> getConfigurationRequests();
    method public long getHardLifetime();
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.IkeAuthConfig getLocalAuthConfig();
    method @NonNull public android.net.ipsec.ike.IkeIdentification getLocalIdentification();
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.IkeAuthConfig getRemoteAuthConfig();
    method @NonNull public android.net.ipsec.ike.IkeIdentification getRemoteIdentification();
    method @NonNull public java.util.List<android.net.ipsec.ike.IkeSaProposal> getSaProposals();
    method @NonNull public java.net.InetAddress getServerAddress();
    method public long getSoftLifetime();
    method @NonNull public android.net.IpSecManager.UdpEncapsulationSocket getUdpEncapsulationSocket();
  }

  public static final class IkeSessionParams.Builder {
    ctor public IkeSessionParams.Builder();
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder addPcscfServerRequest(@NonNull java.net.InetAddress);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder addPcscfServerRequest(int);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder addSaProposal(@NonNull android.net.ipsec.ike.IkeSaProposal);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams build();
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder setAuthDigitalSignature(@Nullable java.security.cert.X509Certificate, @NonNull java.security.cert.X509Certificate, @NonNull java.security.PrivateKey);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder setAuthDigitalSignature(@Nullable java.security.cert.X509Certificate, @NonNull java.security.cert.X509Certificate, @NonNull java.util.List<java.security.cert.X509Certificate>, @NonNull java.security.PrivateKey);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder setAuthEap(@Nullable java.security.cert.X509Certificate, @NonNull android.net.eap.EapSessionConfig);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder setAuthPsk(@NonNull byte[]);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder setLifetime(long, long);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder setLocalIdentification(@NonNull android.net.ipsec.ike.IkeIdentification);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder setRemoteIdentification(@NonNull android.net.ipsec.ike.IkeIdentification);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder setServerAddress(@NonNull java.net.InetAddress);
    method @NonNull public android.net.ipsec.ike.IkeSessionParams.Builder setUdpEncapsulationSocket(@NonNull android.net.IpSecManager.UdpEncapsulationSocket);
  }

  public static interface IkeSessionParams.ConfigRequestIpv4PcscfServer extends android.net.ipsec.ike.IkeSessionParams.IkeConfigRequest {
    method @Nullable public java.net.Inet4Address getAddress();
  }

  public static interface IkeSessionParams.ConfigRequestIpv6PcscfServer extends android.net.ipsec.ike.IkeSessionParams.IkeConfigRequest {
    method @Nullable public java.net.Inet6Address getAddress();
  }

  public abstract static class IkeSessionParams.IkeAuthConfig {
  }

  public static class IkeSessionParams.IkeAuthDigitalSignLocalConfig extends android.net.ipsec.ike.IkeSessionParams.IkeAuthConfig {
    method @NonNull public java.security.cert.X509Certificate getClientEndCertificate();
    method @NonNull public java.util.List<java.security.cert.X509Certificate> getIntermediateCertificates();
    method @NonNull public java.security.PrivateKey getPrivateKey();
  }

  public static class IkeSessionParams.IkeAuthDigitalSignRemoteConfig extends android.net.ipsec.ike.IkeSessionParams.IkeAuthConfig {
    method @Nullable public java.security.cert.X509Certificate getRemoteCaCert();
  }

  public static class IkeSessionParams.IkeAuthEapConfig extends android.net.ipsec.ike.IkeSessionParams.IkeAuthConfig {
    method @NonNull public android.net.eap.EapSessionConfig getEapConfig();
  }

  public static class IkeSessionParams.IkeAuthPskConfig extends android.net.ipsec.ike.IkeSessionParams.IkeAuthConfig {
    method @NonNull public byte[] getPsk();
  }

  public static interface IkeSessionParams.IkeConfigRequest {
  }

  public final class IkeTrafficSelector {
    ctor public IkeTrafficSelector(int, int, @NonNull java.net.InetAddress, @NonNull java.net.InetAddress);
    field public final int endPort;
    field @NonNull public final java.net.InetAddress endingAddress;
    field public final int startPort;
    field @NonNull public final java.net.InetAddress startingAddress;
  }

  public abstract class SaProposal {
    method @NonNull public java.util.List<java.lang.Integer> getDhGroups();
    method @NonNull public java.util.List<android.util.Pair<java.lang.Integer,java.lang.Integer>> getEncryptionAlgorithms();
    method @NonNull public java.util.List<java.lang.Integer> getIntegrityAlgorithms();
    field public static final int DH_GROUP_1024_BIT_MODP = 2; // 0x2
    field public static final int DH_GROUP_2048_BIT_MODP = 14; // 0xe
    field public static final int DH_GROUP_NONE = 0; // 0x0
    field public static final int ENCRYPTION_ALGORITHM_3DES = 3; // 0x3
    field public static final int ENCRYPTION_ALGORITHM_AES_CBC = 12; // 0xc
    field public static final int ENCRYPTION_ALGORITHM_AES_GCM_12 = 19; // 0x13
    field public static final int ENCRYPTION_ALGORITHM_AES_GCM_16 = 20; // 0x14
    field public static final int ENCRYPTION_ALGORITHM_AES_GCM_8 = 18; // 0x12
    field public static final int INTEGRITY_ALGORITHM_AES_XCBC_96 = 5; // 0x5
    field public static final int INTEGRITY_ALGORITHM_HMAC_SHA1_96 = 2; // 0x2
    field public static final int INTEGRITY_ALGORITHM_HMAC_SHA2_256_128 = 12; // 0xc
    field public static final int INTEGRITY_ALGORITHM_HMAC_SHA2_384_192 = 13; // 0xd
    field public static final int INTEGRITY_ALGORITHM_HMAC_SHA2_512_256 = 14; // 0xe
    field public static final int INTEGRITY_ALGORITHM_NONE = 0; // 0x0
    field public static final int KEY_LEN_AES_128 = 128; // 0x80
    field public static final int KEY_LEN_AES_192 = 192; // 0xc0
    field public static final int KEY_LEN_AES_256 = 256; // 0x100
    field public static final int KEY_LEN_UNUSED = 0; // 0x0
    field public static final int PSEUDORANDOM_FUNCTION_AES128_XCBC = 4; // 0x4
    field public static final int PSEUDORANDOM_FUNCTION_HMAC_SHA1 = 2; // 0x2
  }

  public final class TransportModeChildSessionParams extends android.net.ipsec.ike.ChildSessionParams {
  }

  public static final class TransportModeChildSessionParams.Builder {
    ctor public TransportModeChildSessionParams.Builder();
    method @NonNull public android.net.ipsec.ike.TransportModeChildSessionParams.Builder addInboundTrafficSelectors(@NonNull android.net.ipsec.ike.IkeTrafficSelector);
    method @NonNull public android.net.ipsec.ike.TransportModeChildSessionParams.Builder addOutboundTrafficSelectors(@NonNull android.net.ipsec.ike.IkeTrafficSelector);
    method @NonNull public android.net.ipsec.ike.TransportModeChildSessionParams.Builder addSaProposal(@NonNull android.net.ipsec.ike.ChildSaProposal);
    method @NonNull public android.net.ipsec.ike.TransportModeChildSessionParams build();
    method @NonNull public android.net.ipsec.ike.TransportModeChildSessionParams.Builder setLifetime(long, long);
  }

  public final class TunnelModeChildSessionParams extends android.net.ipsec.ike.ChildSessionParams {
    method @NonNull public java.util.List<android.net.ipsec.ike.TunnelModeChildSessionParams.TunnelModeChildConfigRequest> getConfigurationRequests();
  }

  public static final class TunnelModeChildSessionParams.Builder {
    ctor public TunnelModeChildSessionParams.Builder();
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionParams.Builder addInboundTrafficSelectors(@NonNull android.net.ipsec.ike.IkeTrafficSelector);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionParams.Builder addInternalAddressRequest(int);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionParams.Builder addInternalAddressRequest(@NonNull java.net.Inet4Address);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionParams.Builder addInternalAddressRequest(@NonNull java.net.Inet6Address, int);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionParams.Builder addInternalDhcpServerRequest(int);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionParams.Builder addInternalDnsServerRequest(int);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionParams.Builder addOutboundTrafficSelectors(@NonNull android.net.ipsec.ike.IkeTrafficSelector);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionParams.Builder addSaProposal(@NonNull android.net.ipsec.ike.ChildSaProposal);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionParams build();
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionParams.Builder setLifetime(long, long);
  }

  public static interface TunnelModeChildSessionParams.ConfigRequestIpv4Address extends android.net.ipsec.ike.TunnelModeChildSessionParams.TunnelModeChildConfigRequest {
    method @Nullable public java.net.Inet4Address getAddress();
  }

  public static interface TunnelModeChildSessionParams.ConfigRequestIpv4DhcpServer extends android.net.ipsec.ike.TunnelModeChildSessionParams.TunnelModeChildConfigRequest {
    method @Nullable public java.net.Inet4Address getAddress();
  }

  public static interface TunnelModeChildSessionParams.ConfigRequestIpv4DnsServer extends android.net.ipsec.ike.TunnelModeChildSessionParams.TunnelModeChildConfigRequest {
    method @Nullable public java.net.Inet4Address getAddress();
  }

  public static interface TunnelModeChildSessionParams.ConfigRequestIpv4Netmask extends android.net.ipsec.ike.TunnelModeChildSessionParams.TunnelModeChildConfigRequest {
  }

  public static interface TunnelModeChildSessionParams.ConfigRequestIpv6Address extends android.net.ipsec.ike.TunnelModeChildSessionParams.TunnelModeChildConfigRequest {
    method @Nullable public java.net.Inet6Address getAddress();
    method public int getPrefixLength();
  }

  public static interface TunnelModeChildSessionParams.ConfigRequestIpv6DnsServer extends android.net.ipsec.ike.TunnelModeChildSessionParams.TunnelModeChildConfigRequest {
    method @Nullable public java.net.Inet6Address getAddress();
  }

  public static interface TunnelModeChildSessionParams.TunnelModeChildConfigRequest {
  }

}

package android.net.ipsec.ike.exceptions {

  public abstract class IkeException extends java.lang.Exception {
  }

  public final class IkeInternalException extends android.net.ipsec.ike.exceptions.IkeException {
  }

  public abstract class IkeProtocolException extends android.net.ipsec.ike.exceptions.IkeException {
    method @Nullable public byte[] getErrorData();
    method public int getErrorType();
    field public static final int ERROR_TYPE_AUTHENTICATION_FAILED = 24; // 0x18
    field public static final int ERROR_TYPE_CHILD_SA_NOT_FOUND = 44; // 0x2c
    field public static final int ERROR_TYPE_FAILED_CP_REQUIRED = 37; // 0x25
    field public static final int ERROR_TYPE_INTERNAL_ADDRESS_FAILURE = 36; // 0x24
    field public static final int ERROR_TYPE_INVALID_IKE_SPI = 4; // 0x4
    field public static final int ERROR_TYPE_INVALID_KE_PAYLOAD = 17; // 0x11
    field public static final int ERROR_TYPE_INVALID_MAJOR_VERSION = 5; // 0x5
    field public static final int ERROR_TYPE_INVALID_MESSAGE_ID = 9; // 0x9
    field public static final int ERROR_TYPE_INVALID_SELECTORS = 39; // 0x27
    field public static final int ERROR_TYPE_INVALID_SYNTAX = 7; // 0x7
    field public static final int ERROR_TYPE_NO_ADDITIONAL_SAS = 35; // 0x23
    field public static final int ERROR_TYPE_NO_PROPOSAL_CHOSEN = 14; // 0xe
    field public static final int ERROR_TYPE_SINGLE_PAIR_REQUIRED = 34; // 0x22
    field public static final int ERROR_TYPE_TEMPORARY_FAILURE = 43; // 0x2b
    field public static final int ERROR_TYPE_TS_UNACCEPTABLE = 38; // 0x26
    field public static final int ERROR_TYPE_UNSUPPORTED_CRITICAL_PAYLOAD = 1; // 0x1
  }

}

package android.net.metrics {

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

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

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

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

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

  public static final class DhcpClientEvent.Builder {
    ctor public DhcpClientEvent.Builder();
    method @NonNull public android.net.metrics.DhcpClientEvent build();
    method @NonNull public android.net.metrics.DhcpClientEvent.Builder setDurationMs(int);
    method @NonNull 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 = 67174400; // 0x4010000
    field public static final int BUFFER_UNDERFLOW = 83951616; // 0x5010000
    field public static final int DHCP_BAD_MAGIC_COOKIE = 67239936; // 0x4020000
    field public static final int DHCP_ERROR = 4; // 0x4
    field public static final int DHCP_INVALID_OPTION_LENGTH = 67305472; // 0x4030000
    field public static final int DHCP_NO_COOKIE = 67502080; // 0x4060000
    field public static final int DHCP_NO_MSG_TYPE = 67371008; // 0x4040000
    field public static final int DHCP_UNKNOWN_MSG_TYPE = 67436544; // 0x4050000
    field public static final int L2_ERROR = 1; // 0x1
    field public static final int L2_TOO_SHORT = 16842752; // 0x1010000
    field public static final int L2_WRONG_ETH_TYPE = 16908288; // 0x1020000
    field public static final int L3_ERROR = 2; // 0x2
    field public static final int L3_INVALID_IP = 33751040; // 0x2030000
    field public static final int L3_NOT_IPV4 = 33685504; // 0x2020000
    field public static final int L3_TOO_SHORT = 33619968; // 0x2010000
    field public static final int L4_ERROR = 3; // 0x3
    field public static final int L4_NOT_UDP = 50397184; // 0x3010000
    field public static final int L4_WRONG_PORT = 50462720; // 0x3020000
    field public static final int MISC_ERROR = 5; // 0x5
    field public static final int PARSING_ERROR = 84082688; // 0x5030000
    field public static final int RECEIVE_ERROR = 84017152; // 0x5020000
  }

  public class IpConnectivityLog {
    ctor public IpConnectivityLog();
    method public boolean log(long, @NonNull android.net.metrics.IpConnectivityLog.Event);
    method public boolean log(@NonNull String, @NonNull android.net.metrics.IpConnectivityLog.Event);
    method public boolean log(@NonNull android.net.Network, @NonNull int[], @NonNull android.net.metrics.IpConnectivityLog.Event);
    method public boolean log(int, @NonNull int[], @NonNull android.net.metrics.IpConnectivityLog.Event);
    method public boolean log(@NonNull 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_PARTIAL_CONNECTIVITY = 13; // 0xd
    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 final class RaEvent.Builder {
    ctor public RaEvent.Builder();
    method @NonNull public android.net.metrics.RaEvent build();
    method @NonNull public android.net.metrics.RaEvent.Builder updateDnsslLifetime(long);
    method @NonNull public android.net.metrics.RaEvent.Builder updatePrefixPreferredLifetime(long);
    method @NonNull public android.net.metrics.RaEvent.Builder updatePrefixValidLifetime(long);
    method @NonNull public android.net.metrics.RaEvent.Builder updateRdnssLifetime(long);
    method @NonNull public android.net.metrics.RaEvent.Builder updateRouteInfoLifetime(long);
    method @NonNull public android.net.metrics.RaEvent.Builder updateRouterLifetime(long);
  }

  public final class ValidationProbeEvent implements android.net.metrics.IpConnectivityLog.Event {
    method @NonNull 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 final class ValidationProbeEvent.Builder {
    ctor public ValidationProbeEvent.Builder();
    method @NonNull public android.net.metrics.ValidationProbeEvent build();
    method @NonNull public android.net.metrics.ValidationProbeEvent.Builder setDurationMs(long);
    method @NonNull public android.net.metrics.ValidationProbeEvent.Builder setProbeType(int, boolean);
    method @NonNull public android.net.metrics.ValidationProbeEvent.Builder setReturnCode(int);
  }

}

package android.net.netstats.provider {

  public abstract class AbstractNetworkStatsProvider {
    ctor public AbstractNetworkStatsProvider();
    method public abstract void requestStatsUpdate(int);
    method public abstract void setAlert(long);
    method public abstract void setLimit(@NonNull String, long);
    field public static final int QUOTA_UNLIMITED = -1; // 0xffffffff
  }

  public class NetworkStatsProviderCallback {
    method public void onAlertReached();
    method public void onLimitReached();
    method public void onStatsUpdated(int, @NonNull android.net.NetworkStats, @NonNull android.net.NetworkStats);
    method public void unregister();
  }

}

package android.net.sip {

  public class SipAudioCall {
    method @Nullable public android.net.rtp.AudioGroup getAudioGroup();
    method public void setAudioGroup(@NonNull android.net.rtp.AudioGroup);
  }

  public class SipManager {
    method @NonNull public java.util.List<android.net.sip.SipProfile> getProfiles() throws android.net.sip.SipException;
    field public static final String ACTION_SIP_CALL_OPTION_CHANGED = "android.net.sip.action.SIP_CALL_OPTION_CHANGED";
    field public static final String ACTION_SIP_INCOMING_CALL = "android.net.sip.action.SIP_INCOMING_CALL";
    field public static final String ACTION_SIP_REMOVE_PROFILE = "android.net.sip.action.SIP_REMOVE_PROFILE";
    field public static final String ACTION_SIP_SERVICE_UP = "android.net.sip.action.SIP_SERVICE_UP";
    field public static final String ACTION_START_SIP = "android.net.sip.action.START_SIP";
  }

  public class SipProfile implements java.lang.Cloneable android.os.Parcelable java.io.Serializable {
    method public int getCallingUid();
  }

}

package android.net.util {

  public final class SocketUtils {
    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 @NonNull public static java.net.SocketAddress makeNetlinkSocketAddress(int, int);
    method @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, int);
    method @Deprecated @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, @NonNull byte[]);
    method @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, int, @NonNull byte[]);
  }

}

package android.net.wifi {

  public abstract class EasyConnectStatusCallback {
    ctor public EasyConnectStatusCallback();
    method public abstract void onConfiguratorSuccess(int);
    method public abstract void onEnrolleeSuccess(int);
    method public void onFailure(int);
    method public void onFailure(int, @Nullable String, @NonNull android.util.SparseArray<int[]>, @NonNull int[]);
    method public abstract void onProgress(int);
    field public static final int EASY_CONNECT_EVENT_PROGRESS_AUTHENTICATION_SUCCESS = 0; // 0x0
    field public static final int EASY_CONNECT_EVENT_PROGRESS_CONFIGURATION_ACCEPTED = 3; // 0x3
    field public static final int EASY_CONNECT_EVENT_PROGRESS_CONFIGURATION_SENT_WAITING_RESPONSE = 2; // 0x2
    field public static final int EASY_CONNECT_EVENT_PROGRESS_RESPONSE_PENDING = 1; // 0x1
    field public static final int EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_APPLIED = 1; // 0x1
    field public static final int EASY_CONNECT_EVENT_SUCCESS_CONFIGURATION_SENT = 0; // 0x0
  }

  @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 @NonNull 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 ScanResult implements android.os.Parcelable {
    ctor public ScanResult();
    field public static final int CIPHER_CCMP = 3; // 0x3
    field public static final int CIPHER_GCMP_256 = 4; // 0x4
    field public static final int CIPHER_NONE = 0; // 0x0
    field public static final int CIPHER_NO_GROUP_ADDRESSED = 1; // 0x1
    field public static final int CIPHER_SMS4 = 5; // 0x5
    field public static final int CIPHER_TKIP = 2; // 0x2
    field public static final int KEY_MGMT_EAP = 2; // 0x2
    field public static final int KEY_MGMT_EAP_SHA256 = 6; // 0x6
    field public static final int KEY_MGMT_EAP_SUITE_B_192 = 10; // 0xa
    field public static final int KEY_MGMT_FT_EAP = 4; // 0x4
    field public static final int KEY_MGMT_FT_PSK = 3; // 0x3
    field public static final int KEY_MGMT_FT_SAE = 11; // 0xb
    field public static final int KEY_MGMT_NONE = 0; // 0x0
    field public static final int KEY_MGMT_OSEN = 7; // 0x7
    field public static final int KEY_MGMT_OWE = 9; // 0x9
    field public static final int KEY_MGMT_OWE_TRANSITION = 12; // 0xc
    field public static final int KEY_MGMT_PSK = 1; // 0x1
    field public static final int KEY_MGMT_PSK_SHA256 = 5; // 0x5
    field public static final int KEY_MGMT_SAE = 8; // 0x8
    field public static final int KEY_MGMT_WAPI_CERT = 14; // 0xe
    field public static final int KEY_MGMT_WAPI_PSK = 13; // 0xd
    field public static final int PROTOCOL_NONE = 0; // 0x0
    field public static final int PROTOCOL_OSEN = 3; // 0x3
    field public static final int PROTOCOL_RSN = 2; // 0x2
    field public static final int PROTOCOL_WAPI = 4; // 0x4
    field public static final int PROTOCOL_WPA = 1; // 0x1
  }

  public final class SoftApCapability implements android.os.Parcelable {
    method public int describeContents();
    method public int getMaxSupportedClients();
    method public boolean isFeatureSupported(int);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.SoftApCapability> CREATOR;
    field public static final int SOFTAP_FEATURE_ACS_OFFLOAD = 1; // 0x1
    field public static final int SOFTAP_FEATURE_CLIENT_FORCE_DISCONNECT = 2; // 0x2
    field public static final int SOFTAP_FEATURE_WPA3_SAE = 4; // 0x4
  }

  public final class SoftApConfiguration implements android.os.Parcelable {
    method @NonNull public java.util.List<android.net.MacAddress> getAllowedClientList();
    method public int getBand();
    method @NonNull public java.util.List<android.net.MacAddress> getBlockedClientList();
    method public int getChannel();
    method public int getMaxNumberOfClients();
    method public int getShutdownTimeoutMillis();
    method public boolean isAutoShutdownEnabled();
    method public boolean isClientControlByUserEnabled();
    method @Nullable public android.net.wifi.WifiConfiguration toWifiConfiguration();
    field public static final int BAND_2GHZ = 1; // 0x1
    field public static final int BAND_5GHZ = 2; // 0x2
    field public static final int BAND_6GHZ = 4; // 0x4
    field public static final int BAND_ANY = 7; // 0x7
  }

  public static final class SoftApConfiguration.Builder {
    ctor public SoftApConfiguration.Builder();
    ctor public SoftApConfiguration.Builder(@NonNull android.net.wifi.SoftApConfiguration);
    method @NonNull public android.net.wifi.SoftApConfiguration build();
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder enableClientControlByUser(boolean);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setAutoShutdownEnabled(boolean);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setBand(int);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setBssid(@Nullable android.net.MacAddress);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setChannel(int, int);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setClientList(@NonNull java.util.List<android.net.MacAddress>, @NonNull java.util.List<android.net.MacAddress>);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setHiddenSsid(boolean);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setMaxNumberOfClients(@IntRange(from=0) int);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setPassphrase(@Nullable String, int);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setShutdownTimeoutMillis(@IntRange(from=0) int);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setSsid(@Nullable String);
  }

  public final class SoftApInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getBandwidth();
    method public int getFrequency();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int CHANNEL_WIDTH_160MHZ = 6; // 0x6
    field public static final int CHANNEL_WIDTH_20MHZ = 2; // 0x2
    field public static final int CHANNEL_WIDTH_20MHZ_NOHT = 1; // 0x1
    field public static final int CHANNEL_WIDTH_40MHZ = 3; // 0x3
    field public static final int CHANNEL_WIDTH_80MHZ = 4; // 0x4
    field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 5; // 0x5
    field public static final int CHANNEL_WIDTH_INVALID = 0; // 0x0
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.SoftApInfo> CREATOR;
  }

  public final class WifiClient implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.net.MacAddress getMacAddress();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiClient> CREATOR;
  }

  @Deprecated public class WifiConfiguration implements android.os.Parcelable {
    method @Deprecated public int getAuthType();
    method @Deprecated @NonNull public android.net.IpConfiguration getIpConfiguration();
    method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus getNetworkSelectionStatus();
    method @Deprecated @NonNull public String getPrintableSsid();
    method @Deprecated public int getRecentFailureReason();
    method @Deprecated public boolean hasNoInternetAccess();
    method @Deprecated public boolean isEphemeral();
    method @Deprecated public static boolean isMetered(@Nullable android.net.wifi.WifiConfiguration, @Nullable android.net.wifi.WifiInfo);
    method @Deprecated public boolean isNoInternetAccessExpected();
    method @Deprecated public void setIpConfiguration(@Nullable android.net.IpConfiguration);
    method @Deprecated public void setNetworkSelectionStatus(@NonNull android.net.wifi.WifiConfiguration.NetworkSelectionStatus);
    field @Deprecated public static final int INVALID_NETWORK_ID = -1; // 0xffffffff
    field @Deprecated public static final int METERED_OVERRIDE_METERED = 1; // 0x1
    field @Deprecated public static final int METERED_OVERRIDE_NONE = 0; // 0x0
    field @Deprecated public static final int METERED_OVERRIDE_NOT_METERED = 2; // 0x2
    field @Deprecated public static final int RANDOMIZATION_NONE = 0; // 0x0
    field @Deprecated public static final int RANDOMIZATION_PERSISTENT = 1; // 0x1
    field @Deprecated public static final int RECENT_FAILURE_AP_UNABLE_TO_HANDLE_NEW_STA = 17; // 0x11
    field @Deprecated public static final int RECENT_FAILURE_NONE = 0; // 0x0
    field @Deprecated public boolean allowAutojoin;
    field @Deprecated public int carrierId;
    field @Deprecated public String creatorName;
    field @Deprecated public int creatorUid;
    field @Deprecated public boolean fromWifiNetworkSpecifier;
    field @Deprecated public boolean fromWifiNetworkSuggestion;
    field @Deprecated public String lastUpdateName;
    field @Deprecated public int lastUpdateUid;
    field @Deprecated public int macRandomizationSetting;
    field @Deprecated public boolean meteredHint;
    field @Deprecated public int meteredOverride;
    field @Deprecated public int numAssociation;
    field @Deprecated public int numScorerOverride;
    field @Deprecated public int numScorerOverrideAndSwitchedNetwork;
    field @Deprecated public boolean requirePmf;
    field @Deprecated @Nullable public String saePasswordId;
    field @Deprecated public boolean shared;
    field @Deprecated public boolean useExternalScores;
  }

  @Deprecated public static class WifiConfiguration.KeyMgmt {
    field @Deprecated public static final int WAPI_CERT = 14; // 0xe
    field @Deprecated public static final int WAPI_PSK = 13; // 0xd
    field @Deprecated public static final int WPA2_PSK = 4; // 0x4
  }

  @Deprecated public static class WifiConfiguration.NetworkSelectionStatus {
    method @Deprecated public int getDisableReasonCounter(int);
    method @Deprecated public long getDisableTime();
    method @Deprecated public static int getMaxNetworkSelectionDisableReason();
    method @Deprecated @Nullable public static String getNetworkDisableReasonString(int);
    method @Deprecated public int getNetworkSelectionDisableReason();
    method @Deprecated public int getNetworkSelectionStatus();
    method @Deprecated @NonNull public String getNetworkStatusString();
    method @Deprecated public boolean hasEverConnected();
    field @Deprecated public static final int DISABLED_ASSOCIATION_REJECTION = 1; // 0x1
    field @Deprecated public static final int DISABLED_AUTHENTICATION_FAILURE = 2; // 0x2
    field @Deprecated public static final int DISABLED_AUTHENTICATION_NO_CREDENTIALS = 5; // 0x5
    field @Deprecated public static final int DISABLED_AUTHENTICATION_NO_SUBSCRIPTION = 9; // 0x9
    field @Deprecated public static final int DISABLED_BY_WIFI_MANAGER = 7; // 0x7
    field @Deprecated public static final int DISABLED_BY_WRONG_PASSWORD = 8; // 0x8
    field @Deprecated public static final int DISABLED_DHCP_FAILURE = 3; // 0x3
    field @Deprecated public static final int DISABLED_NONE = 0; // 0x0
    field @Deprecated public static final int DISABLED_NO_INTERNET_PERMANENT = 6; // 0x6
    field @Deprecated public static final int DISABLED_NO_INTERNET_TEMPORARY = 4; // 0x4
    field @Deprecated public static final int NETWORK_SELECTION_ENABLED = 0; // 0x0
    field @Deprecated public static final int NETWORK_SELECTION_PERMANENTLY_DISABLED = 2; // 0x2
    field @Deprecated public static final int NETWORK_SELECTION_TEMPORARY_DISABLED = 1; // 0x1
  }

  @Deprecated public static final class WifiConfiguration.NetworkSelectionStatus.Builder {
    ctor @Deprecated public WifiConfiguration.NetworkSelectionStatus.Builder();
    method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus build();
    method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus.Builder setNetworkSelectionDisableReason(int);
    method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus.Builder setNetworkSelectionStatus(int);
  }

  public class WifiEnterpriseConfig implements android.os.Parcelable {
    method @Nullable public String[] getCaCertificateAliases();
    method @NonNull public String getCaPath();
    method @NonNull public String getClientCertificateAlias();
    method public int getOcsp();
    method @NonNull public String getWapiCertSuite();
    method public void setCaCertificateAliases(@Nullable String[]);
    method public void setCaPath(@NonNull String);
    method public void setClientCertificateAlias(@NonNull String);
    method public void setOcsp(int);
    method public void setWapiCertSuite(@NonNull String);
    field public static final int OCSP_NONE = 0; // 0x0
    field public static final int OCSP_REQUEST_CERT_STATUS = 1; // 0x1
    field public static final int OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS = 3; // 0x3
    field public static final int OCSP_REQUIRE_CERT_STATUS = 2; // 0x2
  }

  public class WifiFrameworkInitializer {
    method public static void registerServiceWrappers();
  }

  public class WifiInfo implements android.os.Parcelable {
    method public double getLostTxPacketsPerSecond();
    method @Nullable public String getRequestingPackageName();
    method public double getRetriedTxPacketsPerSecond();
    method public int getScore();
    method public double getSuccessfulRxPacketsPerSecond();
    method public double getSuccessfulTxPacketsPerSecond();
    method public boolean isEphemeral();
    method public boolean isOsuAp();
    method public boolean isPasspointAp();
    method @Nullable public static String sanitizeSsid(@Nullable String);
    field public static final String DEFAULT_MAC_ADDRESS = "02:00:00:00:00:00";
    field public static final int INVALID_RSSI = -127; // 0xffffff81
  }

  public static final class WifiInfo.Builder {
    ctor public WifiInfo.Builder();
    method @NonNull public android.net.wifi.WifiInfo build();
    method @NonNull public android.net.wifi.WifiInfo.Builder setBssid(@NonNull String);
    method @NonNull public android.net.wifi.WifiInfo.Builder setNetworkId(int);
    method @NonNull public android.net.wifi.WifiInfo.Builder setRssi(int);
    method @NonNull public android.net.wifi.WifiInfo.Builder setSsid(@NonNull byte[]);
  }

  public class WifiManager {
    method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void addOnWifiUsabilityStatsListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.OnWifiUsabilityStatsListener);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void allowAutojoin(int, boolean);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void allowAutojoinGlobal(boolean);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void allowAutojoinPasspoint(@NonNull String, boolean);
    method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void clearWifiConnectedNetworkScorer();
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void connect(@NonNull android.net.wifi.WifiConfiguration, @Nullable android.net.wifi.WifiManager.ActionListener);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void connect(int, @Nullable android.net.wifi.WifiManager.ActionListener);
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void disable(int, @Nullable android.net.wifi.WifiManager.ActionListener);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK}) public void disableEphemeralNetwork(@NonNull String);
    method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void factoryReset();
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void forget(int, @Nullable android.net.wifi.WifiManager.ActionListener);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.List<android.util.Pair<android.net.wifi.WifiConfiguration,java.util.Map<java.lang.Integer,java.util.List<android.net.wifi.ScanResult>>>> getAllMatchingWifiConfigs(@NonNull java.util.List<android.net.wifi.ScanResult>);
    method @Nullable @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public String getCountryCode();
    method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public android.net.Network getCurrentNetwork();
    method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public String[] getFactoryMacAddresses();
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.Map<android.net.wifi.hotspot2.OsuProvider,java.util.List<android.net.wifi.ScanResult>> getMatchingOsuProviders(@Nullable java.util.List<android.net.wifi.ScanResult>);
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.Map<android.net.wifi.hotspot2.OsuProvider,android.net.wifi.hotspot2.PasspointConfiguration> getMatchingPasspointConfigsForOsuProviders(@NonNull java.util.Set<android.net.wifi.hotspot2.OsuProvider>);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_WIFI_STATE}) public java.util.Map<android.net.wifi.WifiNetworkSuggestion,java.util.List<android.net.wifi.ScanResult>> getMatchingScanResults(@NonNull java.util.List<android.net.wifi.WifiNetworkSuggestion>, @Nullable java.util.List<android.net.wifi.ScanResult>);
    method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_WIFI_STATE, android.Manifest.permission.READ_WIFI_CREDENTIAL}) public java.util.List<android.net.wifi.WifiConfiguration> getPrivilegedConfiguredNetworks();
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public android.net.wifi.SoftApConfiguration getSoftApConfiguration();
    method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public void getWifiActivityEnergyInfoAsync(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.OnWifiActivityEnergyInfoListener);
    method @Deprecated @Nullable @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 @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.List<android.net.wifi.WifiConfiguration> getWifiConfigForMatchedNetworkSuggestionsSharedWithUser(@NonNull java.util.List<android.net.wifi.ScanResult>);
    method public boolean isApMacRandomizationSupported();
    method public boolean isConnectedMacRandomizationSupported();
    method @Deprecated public boolean isDeviceToDeviceRttSupported();
    method public boolean isPortableHotspotSupported();
    method public boolean isVerboseLoggingEnabled();
    method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public boolean isWifiApEnabled();
    method public boolean isWifiScannerSupported();
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerNetworkRequestMatchCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.NetworkRequestMatchCallback);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerSoftApCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.SoftApCallback);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerTrafficStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.TrafficStateCallback);
    method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void removeOnWifiUsabilityStatsListener(@NonNull android.net.wifi.WifiManager.OnWifiUsabilityStatsListener);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void restoreBackupData(@NonNull byte[]);
    method @Nullable @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public android.net.wifi.SoftApConfiguration restoreSoftApBackupData(@NonNull byte[]);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void restoreSupplicantBackupData(@NonNull byte[], @NonNull byte[]);
    method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public byte[] retrieveBackupData();
    method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public byte[] retrieveSoftApBackupData();
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void save(@NonNull android.net.wifi.WifiConfiguration, @Nullable android.net.wifi.WifiManager.ActionListener);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setAutoWakeupEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.WIFI_SET_DEVICE_MOBILITY_STATE) public void setDeviceMobilityState(int);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setMacRandomizationSettingPasspointEnabled(@NonNull String, boolean);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setMeteredOverridePasspoint(@NonNull String, int);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setScanAlwaysAvailable(boolean);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setScanThrottleEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public boolean setSoftApConfiguration(@NonNull android.net.wifi.SoftApConfiguration);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void setVerboseLoggingEnabled(boolean);
    method @Deprecated @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE) public boolean setWifiApConfiguration(android.net.wifi.WifiConfiguration);
    method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public boolean setWifiConnectedNetworkScorer(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.WifiConnectedNetworkScorer);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startEasyConnectAsConfiguratorInitiator(@NonNull String, int, int, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.EasyConnectStatusCallback);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startEasyConnectAsEnrolleeInitiator(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.EasyConnectStatusCallback);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startLocalOnlyHotspot(@NonNull android.net.wifi.SoftApConfiguration, @Nullable java.util.concurrent.Executor, @Nullable android.net.wifi.WifiManager.LocalOnlyHotspotCallback);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public boolean startScan(android.os.WorkSource);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startSubscriptionProvisioning(@NonNull android.net.wifi.hotspot2.OsuProvider, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.hotspot2.ProvisioningCallback);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public boolean startTetheredHotspot(@Nullable android.net.wifi.SoftApConfiguration);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void stopEasyConnectSession();
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public boolean stopSoftAp();
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterNetworkRequestMatchCallback(@NonNull android.net.wifi.WifiManager.NetworkRequestMatchCallback);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterSoftApCallback(@NonNull android.net.wifi.WifiManager.SoftApCallback);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterTrafficStateCallback(@NonNull android.net.wifi.WifiManager.TrafficStateCallback);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void updateInterfaceIpState(@Nullable String, int);
    method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void updateWifiUsabilityScore(int, int, int);
    field public static final String ACTION_LINK_CONFIGURATION_CHANGED = "android.net.wifi.LINK_CONFIGURATION_CHANGED";
    field @RequiresPermission(android.Manifest.permission.NETWORK_CARRIER_PROVISIONING) public static final String ACTION_NETWORK_SETTINGS_RESET = "android.net.wifi.action.NETWORK_SETTINGS_RESET";
    field public static final String ACTION_PASSPOINT_LAUNCH_OSU_VIEW = "android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW";
    field public static final String ACTION_REQUEST_DISABLE = "android.net.wifi.action.REQUEST_DISABLE";
    field public static final String ACTION_REQUEST_ENABLE = "android.net.wifi.action.REQUEST_ENABLE";
    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 int DEVICE_MOBILITY_STATE_HIGH_MVMT = 1; // 0x1
    field public static final int DEVICE_MOBILITY_STATE_LOW_MVMT = 2; // 0x2
    field public static final int DEVICE_MOBILITY_STATE_STATIONARY = 3; // 0x3
    field public static final int DEVICE_MOBILITY_STATE_UNKNOWN = 0; // 0x0
    field public static final int EASY_CONNECT_NETWORK_ROLE_AP = 1; // 0x1
    field public static final int EASY_CONNECT_NETWORK_ROLE_STA = 0; // 0x0
    field public static final String EXTRA_CHANGE_REASON = "changeReason";
    field public static final String EXTRA_LINK_PROPERTIES = "android.net.wifi.extra.LINK_PROPERTIES";
    field public static final String EXTRA_MULTIPLE_NETWORKS_CHANGED = "multipleChanges";
    field public static final String EXTRA_OSU_NETWORK = "android.net.wifi.extra.OSU_NETWORK";
    field public static final String EXTRA_PREVIOUS_WIFI_AP_STATE = "previous_wifi_state";
    field public static final String EXTRA_URL = "android.net.wifi.extra.URL";
    field public static final String EXTRA_WIFI_AP_FAILURE_REASON = "android.net.wifi.extra.WIFI_AP_FAILURE_REASON";
    field public static final String EXTRA_WIFI_AP_INTERFACE_NAME = "android.net.wifi.extra.WIFI_AP_INTERFACE_NAME";
    field public static final String EXTRA_WIFI_AP_MODE = "android.net.wifi.extra.WIFI_AP_MODE";
    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 int IFACE_IP_MODE_CONFIGURATION_ERROR = 0; // 0x0
    field public static final int IFACE_IP_MODE_LOCAL_ONLY = 2; // 0x2
    field public static final int IFACE_IP_MODE_TETHERED = 1; // 0x1
    field public static final int IFACE_IP_MODE_UNSPECIFIED = -1; // 0xffffffff
    field public static final int PASSPOINT_HOME_NETWORK = 0; // 0x0
    field public static final int PASSPOINT_ROAMING_NETWORK = 1; // 0x1
    field public static final int SAP_CLIENT_BLOCK_REASON_CODE_BLOCKED_BY_USER = 0; // 0x0
    field public static final int SAP_CLIENT_BLOCK_REASON_CODE_NO_MORE_STAS = 1; // 0x1
    field public static final int SAP_START_FAILURE_GENERAL = 0; // 0x0
    field public static final int SAP_START_FAILURE_NO_CHANNEL = 1; // 0x1
    field public static final int SAP_START_FAILURE_UNSUPPORTED_CONFIGURATION = 2; // 0x2
    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 static interface WifiManager.NetworkRequestMatchCallback {
    method public default void onAbort();
    method public default void onMatch(@NonNull java.util.List<android.net.wifi.ScanResult>);
    method public default void onUserSelectionCallbackRegistration(@NonNull android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback);
    method public default void onUserSelectionConnectFailure(@NonNull android.net.wifi.WifiConfiguration);
    method public default void onUserSelectionConnectSuccess(@NonNull android.net.wifi.WifiConfiguration);
  }

  public static interface WifiManager.NetworkRequestUserSelectionCallback {
    method public default void reject();
    method public default void select(@NonNull android.net.wifi.WifiConfiguration);
  }

  public static interface WifiManager.OnWifiActivityEnergyInfoListener {
    method public void onWifiActivityEnergyInfo(@Nullable android.os.connectivity.WifiActivityEnergyInfo);
  }

  public static interface WifiManager.OnWifiUsabilityStatsListener {
    method public void onWifiUsabilityStats(int, boolean, @NonNull android.net.wifi.WifiUsabilityStatsEntry);
  }

  public static interface WifiManager.ScoreChangeCallback {
    method public void onScoreChange(int, @NonNull android.net.NetworkScore);
    method public void onTriggerUpdateOfWifiUsabilityStats(int);
  }

  public static interface WifiManager.SoftApCallback {
    method public default void onBlockedClientConnecting(@NonNull android.net.wifi.WifiClient, int);
    method public default void onCapabilityChanged(@NonNull android.net.wifi.SoftApCapability);
    method public default void onConnectedClientsChanged(@NonNull java.util.List<android.net.wifi.WifiClient>);
    method public default void onInfoChanged(@NonNull android.net.wifi.SoftApInfo);
    method public default void onStateChanged(int, int);
  }

  public static interface WifiManager.TrafficStateCallback {
    method public void onStateChanged(int);
    field public static final int DATA_ACTIVITY_IN = 1; // 0x1
    field public static final int DATA_ACTIVITY_INOUT = 3; // 0x3
    field public static final int DATA_ACTIVITY_NONE = 0; // 0x0
    field public static final int DATA_ACTIVITY_OUT = 2; // 0x2
  }

  public static interface WifiManager.WifiConnectedNetworkScorer {
    method public void setScoreChangeCallback(@NonNull android.net.wifi.WifiManager.ScoreChangeCallback);
    method public void start(int);
    method public void stop(int);
  }

  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 @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiNetworkConnectionStatistics> CREATOR;
    field public int numConnection;
    field public int numUsage;
  }

  public final class WifiNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
    method public boolean satisfiedBy(android.net.NetworkSpecifier);
  }

  public final class WifiNetworkSuggestion implements android.os.Parcelable {
    method @Nullable public android.net.wifi.hotspot2.PasspointConfiguration getPasspointConfiguration();
    method @NonNull public android.net.wifi.WifiConfiguration getWifiConfiguration();
  }

  public static final class WifiNetworkSuggestion.Builder {
    method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_CARRIER_PROVISIONING) public android.net.wifi.WifiNetworkSuggestion.Builder setCarrierId(int);
  }

  public final class WifiOemMigrationHook {
    method @Nullable public static android.net.wifi.WifiOemMigrationHook.ConfigStoreMigrationData loadFromConfigStore();
    method @NonNull public static android.net.wifi.WifiOemMigrationHook.SettingsMigrationData loadFromSettings(@NonNull android.content.Context);
  }

  public static final class WifiOemMigrationHook.ConfigStoreMigrationData implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public java.util.List<android.net.wifi.WifiConfiguration> getUserSavedNetworkConfigurations();
    method @Nullable public android.net.wifi.SoftApConfiguration getUserSoftApConfiguration();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiOemMigrationHook.ConfigStoreMigrationData> CREATOR;
  }

  public static final class WifiOemMigrationHook.ConfigStoreMigrationData.Builder {
    ctor public WifiOemMigrationHook.ConfigStoreMigrationData.Builder();
    method @NonNull public android.net.wifi.WifiOemMigrationHook.ConfigStoreMigrationData build();
    method @NonNull public android.net.wifi.WifiOemMigrationHook.ConfigStoreMigrationData.Builder setUserSavedNetworkConfigurations(@NonNull java.util.List<android.net.wifi.WifiConfiguration>);
    method @NonNull public android.net.wifi.WifiOemMigrationHook.ConfigStoreMigrationData.Builder setUserSoftApConfiguration(@NonNull android.net.wifi.SoftApConfiguration);
  }

  public static final class WifiOemMigrationHook.SettingsMigrationData implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getP2pDeviceName();
    method public boolean isP2pFactoryResetPending();
    method public boolean isScanAlwaysAvailable();
    method public boolean isScanThrottleEnabled();
    method public boolean isSoftApTimeoutEnabled();
    method public boolean isVerboseLoggingEnabled();
    method public boolean isWakeUpEnabled();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiOemMigrationHook.SettingsMigrationData> CREATOR;
  }

  public static final class WifiOemMigrationHook.SettingsMigrationData.Builder {
    ctor public WifiOemMigrationHook.SettingsMigrationData.Builder();
    method @NonNull public android.net.wifi.WifiOemMigrationHook.SettingsMigrationData build();
    method @NonNull public android.net.wifi.WifiOemMigrationHook.SettingsMigrationData.Builder setP2pDeviceName(@Nullable String);
    method @NonNull public android.net.wifi.WifiOemMigrationHook.SettingsMigrationData.Builder setP2pFactoryResetPending(boolean);
    method @NonNull public android.net.wifi.WifiOemMigrationHook.SettingsMigrationData.Builder setScanAlwaysAvailable(boolean);
    method @NonNull public android.net.wifi.WifiOemMigrationHook.SettingsMigrationData.Builder setScanThrottleEnabled(boolean);
    method @NonNull public android.net.wifi.WifiOemMigrationHook.SettingsMigrationData.Builder setSoftApTimeoutEnabled(boolean);
    method @NonNull public android.net.wifi.WifiOemMigrationHook.SettingsMigrationData.Builder setVerboseLoggingEnabled(boolean);
    method @NonNull public android.net.wifi.WifiOemMigrationHook.SettingsMigrationData.Builder setWakeUpEnabled(boolean);
  }

  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 @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<java.lang.Integer> getAvailableChannels(int);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean getScanResults();
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<android.net.wifi.ScanResult> getSingleScanResults();
    method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void registerScanListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setScanningEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
    method @Deprecated @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 @Deprecated @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);
    method public void unregisterScanListener(@NonNull android.net.wifi.WifiScanner.ScanListener);
    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 SCAN_TYPE_HIGH_ACCURACY = 2; // 0x2
    field public static final int SCAN_TYPE_LOW_LATENCY = 0; // 0x0
    field public static final int SCAN_TYPE_LOW_POWER = 1; // 0x1
    field public static final int WIFI_BAND_24_5_6_GHZ = 11; // 0xb
    field public static final int WIFI_BAND_24_5_WITH_DFS_6_GHZ = 15; // 0xf
    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_6_GHZ = 8; // 0x8
    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 @Deprecated 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 @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public final java.util.List<android.net.wifi.WifiScanner.ScanSettings.HiddenNetwork> hiddenNetworks;
    field public boolean hideFromAppOps;
    field public boolean ignoreLocationSettings;
    field @Deprecated public int maxPeriodInMs;
    field @Deprecated public int maxScansToCache;
    field @Deprecated public int numBssidsPerScan;
    field @Deprecated public int periodInMs;
    field @Deprecated public int reportEvents;
    field @Deprecated public int stepCount;
    field @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public int type;
  }

  public static class WifiScanner.ScanSettings.HiddenNetwork {
    ctor public WifiScanner.ScanSettings.HiddenNetwork(@NonNull String);
    field @NonNull public final String ssid;
  }

  @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;
  }

  public final class WifiUsabilityStatsEntry implements android.os.Parcelable {
    method public int describeContents();
    method public int getCellularDataNetworkType();
    method public int getCellularSignalStrengthDb();
    method public int getCellularSignalStrengthDbm();
    method public int getLinkSpeedMbps();
    method public int getProbeElapsedTimeSinceLastUpdateMillis();
    method public int getProbeMcsRateSinceLastUpdate();
    method public int getProbeStatusSinceLastUpdate();
    method public int getRssi();
    method public int getRxLinkSpeedMbps();
    method public long getTimeStampMillis();
    method public long getTotalBackgroundScanTimeMillis();
    method public long getTotalBeaconRx();
    method public long getTotalCcaBusyFreqTimeMillis();
    method public long getTotalHotspot2ScanTimeMillis();
    method public long getTotalNanScanTimeMillis();
    method public long getTotalPnoScanTimeMillis();
    method public long getTotalRadioOnFreqTimeMillis();
    method public long getTotalRadioOnTimeMillis();
    method public long getTotalRadioRxTimeMillis();
    method public long getTotalRadioTxTimeMillis();
    method public long getTotalRoamScanTimeMillis();
    method public long getTotalRxSuccess();
    method public long getTotalScanTimeMillis();
    method public long getTotalTxBad();
    method public long getTotalTxRetries();
    method public long getTotalTxSuccess();
    method public boolean isSameRegisteredCell();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.WifiUsabilityStatsEntry> CREATOR;
    field public static final int PROBE_STATUS_FAILURE = 3; // 0x3
    field public static final int PROBE_STATUS_NO_PROBE = 1; // 0x1
    field public static final int PROBE_STATUS_SUCCESS = 2; // 0x2
    field public static final int PROBE_STATUS_UNKNOWN = 0; // 0x0
  }

}

package android.net.wifi.aware {

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

  public final class WifiAwareNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
    method public boolean satisfiedBy(android.net.NetworkSpecifier);
  }

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

}

package android.net.wifi.hotspot2 {

  public final class OsuProvider implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getFriendlyName();
    method @Nullable public android.net.Uri getServerUri();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.hotspot2.OsuProvider> CREATOR;
  }

  public final class PasspointConfiguration implements android.os.Parcelable {
    method public int getMeteredOverride();
    method public boolean isAutojoinEnabled();
    method public boolean isMacRandomizationEnabled();
  }

  public abstract class ProvisioningCallback {
    ctor public ProvisioningCallback();
    method public abstract void onProvisioningComplete();
    method public abstract void onProvisioningFailure(int);
    method public abstract void onProvisioningStatus(int);
    field public static final int OSU_FAILURE_ADD_PASSPOINT_CONFIGURATION = 22; // 0x16
    field public static final int OSU_FAILURE_AP_CONNECTION = 1; // 0x1
    field public static final int OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU = 8; // 0x8
    field public static final int OSU_FAILURE_NO_AAA_SERVER_TRUST_ROOT_NODE = 17; // 0x11
    field public static final int OSU_FAILURE_NO_AAA_TRUST_ROOT_CERTIFICATE = 21; // 0x15
    field public static final int OSU_FAILURE_NO_OSU_ACTIVITY_FOUND = 14; // 0xe
    field public static final int OSU_FAILURE_NO_POLICY_SERVER_TRUST_ROOT_NODE = 19; // 0x13
    field public static final int OSU_FAILURE_NO_PPS_MO = 16; // 0x10
    field public static final int OSU_FAILURE_NO_REMEDIATION_SERVER_TRUST_ROOT_NODE = 18; // 0x12
    field public static final int OSU_FAILURE_OSU_PROVIDER_NOT_FOUND = 23; // 0x17
    field public static final int OSU_FAILURE_PROVISIONING_ABORTED = 6; // 0x6
    field public static final int OSU_FAILURE_PROVISIONING_NOT_AVAILABLE = 7; // 0x7
    field public static final int OSU_FAILURE_RETRIEVE_TRUST_ROOT_CERTIFICATES = 20; // 0x14
    field public static final int OSU_FAILURE_SERVER_CONNECTION = 3; // 0x3
    field public static final int OSU_FAILURE_SERVER_URL_INVALID = 2; // 0x2
    field public static final int OSU_FAILURE_SERVER_VALIDATION = 4; // 0x4
    field public static final int OSU_FAILURE_SERVICE_PROVIDER_VERIFICATION = 5; // 0x5
    field public static final int OSU_FAILURE_SOAP_MESSAGE_EXCHANGE = 11; // 0xb
    field public static final int OSU_FAILURE_START_REDIRECT_LISTENER = 12; // 0xc
    field public static final int OSU_FAILURE_TIMED_OUT_REDIRECT_LISTENER = 13; // 0xd
    field public static final int OSU_FAILURE_UNEXPECTED_COMMAND_TYPE = 9; // 0x9
    field public static final int OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_STATUS = 15; // 0xf
    field public static final int OSU_FAILURE_UNEXPECTED_SOAP_MESSAGE_TYPE = 10; // 0xa
    field public static final int OSU_STATUS_AP_CONNECTED = 2; // 0x2
    field public static final int OSU_STATUS_AP_CONNECTING = 1; // 0x1
    field public static final int OSU_STATUS_INIT_SOAP_EXCHANGE = 6; // 0x6
    field public static final int OSU_STATUS_REDIRECT_RESPONSE_RECEIVED = 8; // 0x8
    field public static final int OSU_STATUS_RETRIEVING_TRUST_ROOT_CERTS = 11; // 0xb
    field public static final int OSU_STATUS_SECOND_SOAP_EXCHANGE = 9; // 0x9
    field public static final int OSU_STATUS_SERVER_CONNECTED = 5; // 0x5
    field public static final int OSU_STATUS_SERVER_CONNECTING = 3; // 0x3
    field public static final int OSU_STATUS_SERVER_VALIDATED = 4; // 0x4
    field public static final int OSU_STATUS_THIRD_SOAP_EXCHANGE = 10; // 0xa
    field public static final int OSU_STATUS_WAITING_FOR_REDIRECT_RESPONSE = 7; // 0x7
  }

}

package android.net.wifi.nl80211 {

  public final class DeviceWiphyCapabilities implements android.os.Parcelable {
    ctor public DeviceWiphyCapabilities();
    method public int describeContents();
    method public int getMaxNumberRxSpatialStreams();
    method public int getMaxNumberTxSpatialStreams();
    method public boolean isChannelWidthSupported(int);
    method public boolean isWifiStandardSupported(int);
    method public void setChannelWidthSupported(int, boolean);
    method public void setMaxNumberRxSpatialStreams(int);
    method public void setMaxNumberTxSpatialStreams(int);
    method public void setWifiStandardSupport(int, boolean);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.DeviceWiphyCapabilities> CREATOR;
  }

  public final class NativeScanResult implements android.os.Parcelable {
    ctor public NativeScanResult();
    method public int describeContents();
    method @Nullable public android.net.MacAddress getBssid();
    method public int getCapabilities();
    method public int getFrequencyMhz();
    method @NonNull public byte[] getInformationElements();
    method @NonNull public java.util.List<android.net.wifi.nl80211.RadioChainInfo> getRadioChainInfos();
    method public int getSignalMbm();
    method @NonNull public byte[] getSsid();
    method public long getTsf();
    method public boolean isAssociated();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int BSS_CAPABILITY_APSD = 2048; // 0x800
    field public static final int BSS_CAPABILITY_CF_POLLABLE = 4; // 0x4
    field public static final int BSS_CAPABILITY_CF_POLL_REQUEST = 8; // 0x8
    field public static final int BSS_CAPABILITY_CHANNEL_AGILITY = 128; // 0x80
    field public static final int BSS_CAPABILITY_DELAYED_BLOCK_ACK = 16384; // 0x4000
    field public static final int BSS_CAPABILITY_DSSS_OFDM = 8192; // 0x2000
    field public static final int BSS_CAPABILITY_ESS = 1; // 0x1
    field public static final int BSS_CAPABILITY_IBSS = 2; // 0x2
    field public static final int BSS_CAPABILITY_IMMEDIATE_BLOCK_ACK = 32768; // 0x8000
    field public static final int BSS_CAPABILITY_PBCC = 64; // 0x40
    field public static final int BSS_CAPABILITY_PRIVACY = 16; // 0x10
    field public static final int BSS_CAPABILITY_QOS = 512; // 0x200
    field public static final int BSS_CAPABILITY_RADIO_MANAGEMENT = 4096; // 0x1000
    field public static final int BSS_CAPABILITY_SHORT_PREAMBLE = 32; // 0x20
    field public static final int BSS_CAPABILITY_SHORT_SLOT_TIME = 1024; // 0x400
    field public static final int BSS_CAPABILITY_SPECTRUM_MANAGEMENT = 256; // 0x100
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.NativeScanResult> CREATOR;
  }

  public final class NativeWifiClient implements android.os.Parcelable {
    ctor public NativeWifiClient(@Nullable android.net.MacAddress);
    method public int describeContents();
    method @Nullable public android.net.MacAddress getMacAddress();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.NativeWifiClient> CREATOR;
  }

  public final class PnoNetwork implements android.os.Parcelable {
    ctor public PnoNetwork();
    method public int describeContents();
    method @NonNull public int[] getFrequenciesMhz();
    method @NonNull public byte[] getSsid();
    method public boolean isHidden();
    method public void setFrequenciesMhz(@NonNull int[]);
    method public void setHidden(boolean);
    method public void setSsid(@NonNull byte[]);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.PnoNetwork> CREATOR;
  }

  public final class PnoSettings implements android.os.Parcelable {
    ctor public PnoSettings();
    method public int describeContents();
    method public long getIntervalMillis();
    method public int getMin2gRssiDbm();
    method public int getMin5gRssiDbm();
    method public int getMin6gRssiDbm();
    method @NonNull public java.util.List<android.net.wifi.nl80211.PnoNetwork> getPnoNetworks();
    method public void setIntervalMillis(long);
    method public void setMin2gRssiDbm(int);
    method public void setMin5gRssiDbm(int);
    method public void setMin6gRssiDbm(int);
    method public void setPnoNetworks(@NonNull java.util.List<android.net.wifi.nl80211.PnoNetwork>);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.PnoSettings> CREATOR;
  }

  public final class RadioChainInfo implements android.os.Parcelable {
    ctor public RadioChainInfo(int, int);
    method public int describeContents();
    method public int getChainId();
    method public int getLevelDbm();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.nl80211.RadioChainInfo> CREATOR;
  }

  public class WifiNl80211Manager {
    method public void abortScan(@NonNull String);
    method public void enableVerboseLogging(boolean);
    method @NonNull public int[] getChannelsMhzForBand(int);
    method @Nullable public android.net.wifi.nl80211.DeviceWiphyCapabilities getDeviceWiphyCapabilities(@NonNull String);
    method @NonNull public java.util.List<android.net.wifi.nl80211.NativeScanResult> getScanResults(@NonNull String, int);
    method @Nullable public android.net.wifi.nl80211.WifiNl80211Manager.TxPacketCounters getTxPacketCounters(@NonNull String);
    method @Nullable public static android.net.wifi.nl80211.WifiNl80211Manager.OemSecurityType parseOemSecurityTypeElement(int, int, @NonNull byte[]);
    method public boolean registerApCallback(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.SoftApCallback);
    method public void sendMgmtFrame(@NonNull String, @NonNull byte[], int, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.SendMgmtFrameCallback);
    method public void setOnServiceDeadCallback(@NonNull Runnable);
    method public boolean setupInterfaceForClientMode(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.ScanEventCallback, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.ScanEventCallback);
    method public boolean setupInterfaceForSoftApMode(@NonNull String);
    method @Nullable public android.net.wifi.nl80211.WifiNl80211Manager.SignalPollResult signalPoll(@NonNull String);
    method public boolean startPnoScan(@NonNull String, @NonNull android.net.wifi.nl80211.PnoSettings, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.PnoScanRequestCallback);
    method public boolean startScan(@NonNull String, int, @Nullable java.util.Set<java.lang.Integer>, @Nullable java.util.List<byte[]>);
    method public boolean stopPnoScan(@NonNull String);
    method public boolean tearDownClientInterface(@NonNull String);
    method public boolean tearDownInterfaces();
    method public boolean tearDownSoftApInterface(@NonNull String);
    field public static final int SCAN_TYPE_PNO_SCAN = 1; // 0x1
    field public static final int SCAN_TYPE_SINGLE_SCAN = 0; // 0x0
    field public static final int SEND_MGMT_FRAME_ERROR_ALREADY_STARTED = 5; // 0x5
    field public static final int SEND_MGMT_FRAME_ERROR_MCS_UNSUPPORTED = 2; // 0x2
    field public static final int SEND_MGMT_FRAME_ERROR_NO_ACK = 3; // 0x3
    field public static final int SEND_MGMT_FRAME_ERROR_TIMEOUT = 4; // 0x4
    field public static final int SEND_MGMT_FRAME_ERROR_UNKNOWN = 1; // 0x1
  }

  public static class WifiNl80211Manager.OemSecurityType {
    ctor public WifiNl80211Manager.OemSecurityType(int, @NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.lang.Integer>, int);
    field public final int groupCipher;
    field @NonNull public final java.util.List<java.lang.Integer> keyManagement;
    field @NonNull public final java.util.List<java.lang.Integer> pairwiseCipher;
    field public final int protocol;
  }

  public static interface WifiNl80211Manager.PnoScanRequestCallback {
    method public void onPnoRequestFailed();
    method public void onPnoRequestSucceeded();
  }

  public static interface WifiNl80211Manager.ScanEventCallback {
    method public void onScanFailed();
    method public void onScanResultReady();
  }

  public static interface WifiNl80211Manager.SendMgmtFrameCallback {
    method public void onAck(int);
    method public void onFailure(int);
  }

  public static class WifiNl80211Manager.SignalPollResult {
    field public final int associationFrequencyMHz;
    field public final int currentRssiDbm;
    field public final int rxBitrateMbps;
    field public final int txBitrateMbps;
  }

  public static interface WifiNl80211Manager.SoftApCallback {
    method public void onConnectedClientsChanged(@NonNull android.net.wifi.nl80211.NativeWifiClient, boolean);
    method public void onFailure();
    method public void onSoftApChannelSwitched(int, int);
  }

  public static class WifiNl80211Manager.TxPacketCounters {
    field public final int txPacketFailed;
    field public final int txPacketSucceeded;
  }

}

package android.net.wifi.p2p {

  public final class WifiP2pGroupList implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.List<android.net.wifi.p2p.WifiP2pGroup> getGroupList();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.p2p.WifiP2pGroupList> CREATOR;
  }

  public class WifiP2pManager {
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public void deletePersistentGroup(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, int, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void factoryReset(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.READ_WIFI_CREDENTIAL}) public void requestPersistentGroupInfo(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.PersistentGroupInfoListener);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public void setDeviceName(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @NonNull String, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method @RequiresPermission(allOf={android.Manifest.permission.CONNECTIVITY_INTERNAL, android.Manifest.permission.CONFIGURE_WIFI_DISPLAY}) public void setMiracastMode(int);
    method @RequiresPermission(android.Manifest.permission.CONFIGURE_WIFI_DISPLAY) public void setWfdInfo(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @NonNull android.net.wifi.p2p.WifiP2pWfdInfo, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.OVERRIDE_WIFI_CONFIG}) public void setWifiP2pChannels(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, int, int, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void startListening(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void stopListening(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, @Nullable android.net.wifi.p2p.WifiP2pManager.ActionListener);
    field public static final String ACTION_WIFI_P2P_PERSISTENT_GROUPS_CHANGED = "android.net.wifi.p2p.action.WIFI_P2P_PERSISTENT_GROUPS_CHANGED";
    field public static final int MIRACAST_DISABLED = 0; // 0x0
    field public static final int MIRACAST_SINK = 2; // 0x2
    field public static final int MIRACAST_SOURCE = 1; // 0x1
  }

  public static interface WifiP2pManager.PersistentGroupInfoListener {
    method public void onPersistentGroupInfoAvailable(@NonNull android.net.wifi.p2p.WifiP2pGroupList);
  }

}

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 @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.rtt.ResponderConfig> CREATOR;
    field public static final int PREAMBLE_HE = 3; // 0x3
    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 final class ResponderLocation implements android.os.Parcelable {
    method public boolean getExtraInfoOnAssociationIndication();
  }

  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 enableSecureNfc(boolean);
    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);
    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 {
    method @RequiresPermission(android.Manifest.permission.POWER_SAVER) public boolean setChargingStateUpdateDelayMillis(int);
    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 final class BatterySaverPolicyConfig implements android.os.Parcelable {
    method public int describeContents();
    method public float getAdjustBrightnessFactor();
    method public boolean getAdvertiseIsEnabled();
    method public boolean getDeferFullBackup();
    method public boolean getDeferKeyValueBackup();
    method @NonNull public java.util.Map<java.lang.String,java.lang.String> getDeviceSpecificSettings();
    method public boolean getDisableAnimation();
    method public boolean getDisableAod();
    method public boolean getDisableLaunchBoost();
    method public boolean getDisableOptionalSensors();
    method public boolean getDisableSoundTrigger();
    method public boolean getDisableVibration();
    method public boolean getEnableAdjustBrightness();
    method public boolean getEnableDataSaver();
    method public boolean getEnableFirewall();
    method public boolean getEnableNightMode();
    method public boolean getEnableQuickDoze();
    method public boolean getForceAllAppsStandby();
    method public boolean getForceBackgroundCheck();
    method public int getLocationMode();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.os.BatterySaverPolicyConfig> CREATOR;
  }

  public static final class BatterySaverPolicyConfig.Builder {
    ctor public BatterySaverPolicyConfig.Builder();
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder addDeviceSpecificSetting(@NonNull String, @NonNull String);
    method @NonNull public android.os.BatterySaverPolicyConfig build();
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setAdjustBrightnessFactor(float);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setAdvertiseIsEnabled(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDeferFullBackup(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDeferKeyValueBackup(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableAnimation(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableAod(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableLaunchBoost(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableOptionalSensors(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableSoundTrigger(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setDisableVibration(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setEnableAdjustBrightness(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setEnableDataSaver(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setEnableFirewall(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setEnableNightMode(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setEnableQuickDoze(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setForceAllAppsStandby(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setForceBackgroundCheck(boolean);
    method @NonNull public android.os.BatterySaverPolicyConfig.Builder setLocationMode(int);
  }

  public final class BatteryStatsManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.os.connectivity.CellularBatteryStats getCellularBatteryStats();
    method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.os.connectivity.WifiBatteryStats getWifiBatteryStats();
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportFullWifiLockAcquiredFromSource(@NonNull android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportFullWifiLockReleasedFromSource(@NonNull android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiBatchedScanStartedFromSource(@NonNull android.os.WorkSource, @IntRange(from=0) int);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiBatchedScanStoppedFromSource(@NonNull android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiMulticastDisabled(int);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiMulticastEnabled(int);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiOff();
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiOn();
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiRssiChanged(@IntRange(from=0xffffff81, to=0) int);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiScanStartedFromSource(@NonNull android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiScanStoppedFromSource(@NonNull android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiState(int, @Nullable String);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void reportWifiSupplicantStateChanged(int, boolean);
    field public static final int WIFI_STATE_OFF = 0; // 0x0
    field public static final int WIFI_STATE_OFF_SCANNING = 1; // 0x1
    field public static final int WIFI_STATE_ON_CONNECTED_P2P = 5; // 0x5
    field public static final int WIFI_STATE_ON_CONNECTED_STA = 4; // 0x4
    field public static final int WIFI_STATE_ON_CONNECTED_STA_P2P = 6; // 0x6
    field public static final int WIFI_STATE_ON_DISCONNECTED = 3; // 0x3
    field public static final int WIFI_STATE_ON_NO_NETWORKS = 2; // 0x2
    field public static final int WIFI_STATE_SOFT_AP = 7; // 0x7
    field public static final int WIFI_SUPPL_STATE_ASSOCIATED = 7; // 0x7
    field public static final int WIFI_SUPPL_STATE_ASSOCIATING = 6; // 0x6
    field public static final int WIFI_SUPPL_STATE_AUTHENTICATING = 5; // 0x5
    field public static final int WIFI_SUPPL_STATE_COMPLETED = 10; // 0xa
    field public static final int WIFI_SUPPL_STATE_DISCONNECTED = 1; // 0x1
    field public static final int WIFI_SUPPL_STATE_DORMANT = 11; // 0xb
    field public static final int WIFI_SUPPL_STATE_FOUR_WAY_HANDSHAKE = 8; // 0x8
    field public static final int WIFI_SUPPL_STATE_GROUP_HANDSHAKE = 9; // 0x9
    field public static final int WIFI_SUPPL_STATE_INACTIVE = 3; // 0x3
    field public static final int WIFI_SUPPL_STATE_INTERFACE_DISABLED = 2; // 0x2
    field public static final int WIFI_SUPPL_STATE_INVALID = 0; // 0x0
    field public static final int WIFI_SUPPL_STATE_SCANNING = 4; // 0x4
    field public static final int WIFI_SUPPL_STATE_UNINITIALIZED = 12; // 0xc
  }

  public class Binder implements android.os.IBinder {
    method public int handleShellCommand(@NonNull android.os.ParcelFileDescriptor, @NonNull android.os.ParcelFileDescriptor, @NonNull android.os.ParcelFileDescriptor, @NonNull String[]);
    method public static void setProxyTransactListener(@Nullable android.os.Binder.ProxyTransactListener);
  }

  public static interface Binder.ProxyTransactListener {
    method public void onTransactEnded(@Nullable Object);
    method @Nullable public Object onTransactStarted(@NonNull android.os.IBinder, int);
  }

  public final class BugreportManager {
    method @RequiresPermission(android.Manifest.permission.DUMP) public void cancelBugreport();
    method @RequiresPermission(android.Manifest.permission.DUMP) public void requestBugreport(@NonNull android.os.BugreportParams, @Nullable CharSequence, @Nullable CharSequence);
    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(@FloatRange(from=0.0f, to=100.0f) 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(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
  }

  public static class Build.VERSION {
    field @NonNull public static final String PREVIEW_SDK_FINGERPRINT;
  }

  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_CONVERSATION_ACTIONS = "android.intent.action.UPDATE_CONVERSATION_ACTIONS";
    field public static final String ACTION_UPDATE_CT_LOGS = "android.intent.action.UPDATE_CT_LOGS";
    field public static final String ACTION_UPDATE_EMERGENCY_NUMBER_DB = "android.os.action.UPDATE_EMERGENCY_NUMBER_DB";
    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 Environment {
    method @NonNull public static java.util.Collection<java.io.File> getInternalMediaDirectories();
    method @NonNull public static java.io.File getOdmDirectory();
    method @NonNull public static java.io.File getOemDirectory();
    method @NonNull public static java.io.File getProductDirectory();
    method @Deprecated @NonNull public static java.io.File getProductServicesDirectory();
    method @NonNull public static java.io.File getSystemExtDirectory();
    method @NonNull public static java.io.File getVendorDirectory();
  }

  public class HidlMemory implements java.io.Closeable {
    ctor public HidlMemory(@NonNull String, @IntRange(from=0) long, @Nullable android.os.NativeHandle);
    method public void close() throws java.io.IOException;
    method @NonNull public android.os.HidlMemory dup() throws java.io.IOException;
    method protected void finalize();
    method @Nullable public android.os.NativeHandle getHandle();
    method @NonNull public String getName();
    method public long getSize();
    method @Nullable public android.os.NativeHandle releaseHandle();
  }

  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 long getFieldHandle(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 putHidlMemory(long, @NonNull android.os.HidlMemory);
    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 @NonNull @Nullable public final android.os.HidlMemory readEmbeddedHidlMemory(long, long, long);
    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 @NonNull public final android.os.HidlMemory readHidlMemory();
    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 writeHidlMemory(@NonNull android.os.HidlMemory);
    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
  }

  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(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public void approveReport(android.net.Uri);
    method @RequiresPermission("android.permission.REQUEST_INCIDENT_REPORT_APPROVAL") public void cancelAuthorization(android.os.IncidentManager.AuthListener);
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void deleteIncidentReports(android.net.Uri);
    method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public void denyReport(android.net.Uri);
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public android.os.IncidentManager.IncidentReport getIncidentReport(android.net.Uri);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public java.util.List<android.net.Uri> getIncidentReportList(String);
    method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public java.util.List<android.os.IncidentManager.PendingReport> getPendingReports();
    method public void registerSection(int, @NonNull String, @NonNull android.os.IncidentManager.DumpCallback);
    method public void registerSection(int, @NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.IncidentManager.DumpCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void reportIncident(android.os.IncidentReportArgs);
    method @RequiresPermission("android.permission.REQUEST_INCIDENT_REPORT_APPROVAL") public void requestAuthorization(int, String, int, android.os.IncidentManager.AuthListener);
    method public void unregisterSection(int);
    field public static final int FLAG_CONFIRMATION_DIALOG = 1; // 0x1
    field public static final int PRIVACY_POLICY_AUTO = 200; // 0xc8
    field public static final int PRIVACY_POLICY_EXPLICIT = 100; // 0x64
    field public static final int PRIVACY_POLICY_LOCAL = 0; // 0x0
  }

  public static class IncidentManager.AuthListener {
    ctor public IncidentManager.AuthListener();
    method public void onReportApproved();
    method public void onReportDenied();
  }

  public static class IncidentManager.DumpCallback {
    ctor public IncidentManager.DumpCallback();
    method public void onDumpSection(int, @NonNull java.io.OutputStream);
  }

  public static class IncidentManager.IncidentReport implements java.io.Closeable android.os.Parcelable {
    ctor public IncidentManager.IncidentReport(android.os.Parcel);
    method public void close();
    method public int describeContents();
    method public java.io.InputStream getInputStream() throws java.io.IOException;
    method public long getPrivacyPolicy();
    method public long getTimestamp();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.os.IncidentManager.IncidentReport> CREATOR;
  }

  public static class IncidentManager.PendingReport {
    ctor public IncidentManager.PendingReport(@NonNull android.net.Uri);
    method public int getFlags();
    method @NonNull public String getRequestingPackage();
    method public long getTimestamp();
    method @NonNull public android.net.Uri getUri();
  }

  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 setPrivacyPolicy(int);
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull 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 class ParcelFileDescriptor implements java.io.Closeable android.os.Parcelable {
    method @NonNull public static android.os.ParcelFileDescriptor wrap(@NonNull android.os.ParcelFileDescriptor, @NonNull android.os.Handler, @NonNull android.os.ParcelFileDescriptor.OnCloseListener) throws java.io.IOException;
  }

  public final class PowerManager {
    method @RequiresPermission(allOf={android.Manifest.permission.READ_DREAM_STATE, android.Manifest.permission.WRITE_DREAM_STATE}) public void dream(long);
    method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public boolean forceSuspend();
    method @RequiresPermission(android.Manifest.permission.POWER_SAVER) public int getPowerSaveModeTrigger();
    method @RequiresPermission(android.Manifest.permission.READ_DREAM_STATE) public boolean isAmbientDisplayAvailable();
    method @RequiresPermission(android.Manifest.permission.READ_DREAM_STATE) public boolean isAmbientDisplaySuppressed();
    method @RequiresPermission(android.Manifest.permission.READ_DREAM_STATE) public boolean isAmbientDisplaySuppressedForToken(@NonNull String);
    method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.POWER_SAVER}) public boolean setAdaptivePowerSaveEnabled(boolean);
    method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.POWER_SAVER}) public boolean setAdaptivePowerSavePolicy(@NonNull android.os.BatterySaverPolicyConfig);
    method @RequiresPermission(android.Manifest.permission.POWER_SAVER) public boolean setDynamicPowerSaveHint(boolean, int);
    method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.POWER_SAVER}) public boolean setPowerSaveModeEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void suppressAmbientDisplay(@NonNull String, boolean);
    method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.USER_ACTIVITY}) public void userActivity(long, int, int);
    field public static final int POWER_SAVE_MODE_TRIGGER_DYNAMIC = 1; // 0x1
    field public static final int POWER_SAVE_MODE_TRIGGER_PERCENTAGE = 0; // 0x0
    field public static final String REBOOT_USERSPACE = "userspace";
    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 PowerWhitelistManager {
    method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public void addToWhitelist(@NonNull String);
    method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public void addToWhitelist(@NonNull java.util.List<java.lang.String>);
    method @RequiresPermission(android.Manifest.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST) public void whitelistAppTemporarily(@NonNull String, long);
    method @RequiresPermission(android.Manifest.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST) public long whitelistAppTemporarilyForEvent(@NonNull String, int, @NonNull String);
    field public static final int EVENT_MMS = 2; // 0x2
    field public static final int EVENT_SMS = 1; // 0x1
    field public static final int EVENT_UNSPECIFIED = 0; // 0x0
  }

  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 boolean clearPrepareForUnattendedUpdate(@NonNull 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 prepareForUnattendedUpdate(@NonNull android.content.Context, @NonNull String, @Nullable android.content.IntentSender) 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(android.Manifest.permission.RECOVERY) public static boolean rebootAndApply(@NonNull android.content.Context, @NonNull String, @NonNull String) 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 @NonNull public static final android.os.Parcelable.Creator<android.os.RemoteCallback> CREATOR;
  }

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

  public class ServiceSpecificException extends java.lang.RuntimeException {
    ctor public ServiceSpecificException(int, @Nullable 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 @NonNull 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 SystemConfigManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_CARRIER_APP_INFO) public java.util.Set<java.lang.String> getDisabledUntilUsedPreinstalledCarrierApps();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_CARRIER_APP_INFO) public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getDisabledUntilUsedPreinstalledCarrierAssociatedApps();
  }

  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 TelephonyServiceManager {
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getCarrierConfigServiceRegisterer();
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getEuiccCardControllerServiceRegisterer();
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getEuiccControllerService();
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getIccPhoneBookServiceRegisterer();
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getOpportunisticNetworkServiceRegisterer();
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getPhoneSubServiceRegisterer();
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getSmsServiceRegisterer();
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getSubscriptionServiceRegisterer();
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getTelephonyImsServiceRegisterer();
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getTelephonyRcsMessageServiceRegisterer();
    method @NonNull public android.os.TelephonyServiceManager.ServiceRegisterer getTelephonyServiceRegisterer();
  }

  public static class TelephonyServiceManager.ServiceNotFoundException extends java.lang.Exception {
    ctor public TelephonyServiceManager.ServiceNotFoundException(@NonNull String);
  }

  public static final class TelephonyServiceManager.ServiceRegisterer {
    method @Nullable public android.os.IBinder get();
    method @NonNull public android.os.IBinder getOrThrow() throws android.os.TelephonyServiceManager.ServiceNotFoundException;
    method public void register(@NonNull android.os.IBinder);
    method @Nullable public android.os.IBinder tryGet();
  }

  public class UpdateEngine {
    ctor public UpdateEngine();
    method @NonNull @WorkerThread public android.os.UpdateEngine.AllocateSpaceResult allocateSpace(@NonNull String, @NonNull String[]);
    method public void applyPayload(String, long, long, String[]);
    method public void applyPayload(@NonNull android.content.res.AssetFileDescriptor, @NonNull String[]);
    method public boolean bind(android.os.UpdateEngineCallback, android.os.Handler);
    method public boolean bind(android.os.UpdateEngineCallback);
    method public void cancel();
    method @WorkerThread public int cleanupAppliedPayload();
    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.AllocateSpaceResult {
    method public int getErrorCode();
    method public long getFreeSpaceRequired();
  }

  public static final class UpdateEngine.ErrorCodeConstants {
    ctor public UpdateEngine.ErrorCodeConstants();
    field public static final int DEVICE_CORRUPTED = 61; // 0x3d
    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 NOT_ENOUGH_SPACE = 60; // 0x3c
    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 PAYLOAD_TIMESTAMP_ERROR = 51; // 0x33
    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 @NonNull public static String formatUid(int);
    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 @NonNull public static final android.os.UserHandle ALL;
    field @NonNull public static final android.os.UserHandle CURRENT;
    field @NonNull public static final android.os.UserHandle SYSTEM;
  }

  public class UserManager {
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void clearSeedAccountData();
    method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public android.os.UserHandle createProfile(@NonNull String, @NonNull String, @Nullable String[]) throws android.os.UserManager.UserOperationException;
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.os.UserHandle getProfileParent(@NonNull android.os.UserHandle);
    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 @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public java.util.List<android.os.UserHandle> getUserHandles(boolean);
    method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.GET_ACCOUNTS_PRIVILEGED}) public android.graphics.Bitmap getUserIcon();
    method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}, conditional=true) public java.util.List<android.os.UserHandle> getUserProfiles(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 @RequiresPermission(allOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public int getUserSwitchability();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean hasRestrictedProfiles();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean hasUserRestrictionForUser(@NonNull String, @NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isAdminUser();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isGuestUser();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean isManagedProfile(int);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isPrimaryUser();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean isProfile();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isRestrictedProfile();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean isRestrictedProfile(@NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isSameProfileGroup(@NonNull android.os.UserHandle, @NonNull android.os.UserHandle);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.GET_ACCOUNTS_PRIVILEGED}) public boolean isUserNameSet();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isUserOfType(@NonNull String);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean isUserUnlockingOrUnlocked(@NonNull android.os.UserHandle);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public boolean removeUser(@NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void setUserIcon(@NonNull android.graphics.Bitmap) throws android.os.UserManager.UserOperationException;
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void setUserName(@Nullable String);
    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
    field public static final int SWITCHABILITY_STATUS_OK = 0; // 0x0
    field public static final int SWITCHABILITY_STATUS_SYSTEM_USER_LOCKED = 4; // 0x4
    field public static final int SWITCHABILITY_STATUS_USER_IN_CALL = 1; // 0x1
    field public static final int SWITCHABILITY_STATUS_USER_SWITCH_DISALLOWED = 2; // 0x2
    field public static final String USER_TYPE_FULL_SECONDARY = "android.os.usertype.full.SECONDARY";
    field public static final String USER_TYPE_FULL_SYSTEM = "android.os.usertype.full.SYSTEM";
    field public static final String USER_TYPE_PROFILE_MANAGED = "android.os.usertype.profile.MANAGED";
    field public static final String USER_TYPE_SYSTEM_HEADLESS = "android.os.usertype.system.HEADLESS";
  }

  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 @NonNull 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 abstract class Vibrator {
    method @RequiresPermission(android.Manifest.permission.ACCESS_VIBRATOR_STATE) public void addVibratorStateListener(@NonNull android.os.Vibrator.OnVibratorStateChangedListener);
    method @RequiresPermission(android.Manifest.permission.ACCESS_VIBRATOR_STATE) public void addVibratorStateListener(@NonNull java.util.concurrent.Executor, @NonNull android.os.Vibrator.OnVibratorStateChangedListener);
    method @RequiresPermission(android.Manifest.permission.ACCESS_VIBRATOR_STATE) public boolean isVibrating();
    method @RequiresPermission(android.Manifest.permission.ACCESS_VIBRATOR_STATE) public void removeVibratorStateListener(@NonNull android.os.Vibrator.OnVibratorStateChangedListener);
  }

  public static interface Vibrator.OnVibratorStateChangedListener {
    method public void onVibratorStateChanged(boolean);
  }

  public class WorkSource implements android.os.Parcelable {
    ctor public WorkSource(int);
    ctor public WorkSource(int, @NonNull String);
    method public android.os.WorkSource.WorkChain createWorkChain();
    method @Nullable public String getPackageName(int);
    method public int getUid(int);
    method @Nullable public java.util.List<android.os.WorkSource.WorkChain> getWorkChains();
    method public boolean isEmpty();
    method public int size();
    method @NonNull public android.os.WorkSource withoutNames();
  }

  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 @NonNull public static final android.os.Parcelable.Creator<android.os.WorkSource.WorkChain> CREATOR;
  }

}

package android.os.connectivity {

  public final class CellularBatteryStats implements android.os.Parcelable {
    method public int describeContents();
    method public long getEnergyConsumedMaMillis();
    method public long getIdleTimeMillis();
    method public long getKernelActiveTimeMillis();
    method public long getLoggingDurationMillis();
    method public long getMonitoredRailChargeConsumedMaMillis();
    method public long getNumBytesRx();
    method public long getNumBytesTx();
    method public long getNumPacketsRx();
    method public long getNumPacketsTx();
    method public long getRxTimeMillis();
    method public long getSleepTimeMillis();
    method @NonNull public long[] getTimeInRatMicros();
    method @NonNull public long[] getTimeInRxSignalStrengthLevelMicros();
    method @NonNull public long[] getTxTimeMillis();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.os.connectivity.CellularBatteryStats> CREATOR;
  }

  public final class WifiActivityEnergyInfo implements android.os.Parcelable {
    ctor public WifiActivityEnergyInfo(long, int, @IntRange(from=0) long, @IntRange(from=0) long, @IntRange(from=0) long, @IntRange(from=0) long);
    method public int describeContents();
    method @IntRange(from=0) public long getControllerEnergyUsedMicroJoules();
    method @IntRange(from=0) public long getControllerIdleDurationMillis();
    method @IntRange(from=0) public long getControllerRxDurationMillis();
    method @IntRange(from=0) public long getControllerScanDurationMillis();
    method @IntRange(from=0) public long getControllerTxDurationMillis();
    method public int getStackState();
    method public long getTimeSinceBootMillis();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.os.connectivity.WifiActivityEnergyInfo> CREATOR;
    field public static final int STACK_STATE_INVALID = 0; // 0x0
    field public static final int STACK_STATE_STATE_ACTIVE = 1; // 0x1
    field public static final int STACK_STATE_STATE_IDLE = 3; // 0x3
    field public static final int STACK_STATE_STATE_SCANNING = 2; // 0x2
  }

  public final class WifiBatteryStats implements android.os.Parcelable {
    method public int describeContents();
    method public long getAppScanRequestCount();
    method public long getEnergyConsumedMaMillis();
    method public long getIdleTimeMillis();
    method public long getKernelActiveTimeMillis();
    method public long getLoggingDurationMillis();
    method public long getMonitoredRailChargeConsumedMaMillis();
    method public long getNumBytesRx();
    method public long getNumBytesTx();
    method public long getNumPacketsRx();
    method public long getNumPacketsTx();
    method public long getRxTimeMillis();
    method public long getScanTimeMillis();
    method public long getSleepTimeMillis();
    method public long getTxTimeMillis();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.os.connectivity.WifiBatteryStats> CREATOR;
  }

}

package android.os.ext {

  public class SdkExtensions {
    method public static int getExtensionVersion(int);
  }

}

package android.os.ext.test {

  @Deprecated public class Test {
    method @Deprecated public void testF();
    method @Deprecated public void testG();
  }

}

package android.os.image {

  public class DynamicSystemClient {
    ctor public DynamicSystemClient(@NonNull android.content.Context);
    method @RequiresPermission(android.Manifest.permission.INSTALL_DYNAMIC_SYSTEM) public void bind();
    method public void setOnStatusChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.os.image.DynamicSystemClient.OnStatusChangedListener);
    method public void setOnStatusChangedListener(@NonNull android.os.image.DynamicSystemClient.OnStatusChangedListener);
    method @RequiresPermission(android.Manifest.permission.INSTALL_DYNAMIC_SYSTEM) public void start(@NonNull android.net.Uri, long);
    method @RequiresPermission(android.Manifest.permission.INSTALL_DYNAMIC_SYSTEM) public void start(@NonNull android.net.Uri, long, long);
    method @RequiresPermission(android.Manifest.permission.INSTALL_DYNAMIC_SYSTEM) 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 DynamicSystemClient.OnStatusChangedListener {
    method public void onStatusChanged(int, int, long, @Nullable Throwable);
  }

}

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;
    method public static boolean hasIsolatedStorage();
    method public void updateExternalStorageFileQuotaType(@NonNull java.io.File, int) throws java.io.IOException;
    field @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1
    field public static final int QUOTA_TYPE_MEDIA_AUDIO = 2; // 0x2
    field public static final int QUOTA_TYPE_MEDIA_IMAGE = 1; // 0x1
    field public static final int QUOTA_TYPE_MEDIA_NONE = 0; // 0x0
    field public static final int QUOTA_TYPE_MEDIA_VIDEO = 3; // 0x3
  }

  public final class StorageVolume implements android.os.Parcelable {
    method @NonNull public String getId();
  }

}

package android.permission {

  public final class PermissionControllerManager {
    method @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.RESTORE_RUNTIME_PERMISSIONS}) public void applyStagedRuntimePermissionBackup(@NonNull String, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @RequiresPermission(android.Manifest.permission.GET_RUNTIME_PERMISSIONS) public void getRuntimePermissionBackup(@NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<byte[]>);
    method @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) public void revokeRuntimePermissions(@NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>, boolean, int, @NonNull java.util.concurrent.Executor, @NonNull android.permission.PermissionControllerManager.OnRevokeRuntimePermissionsCallback);
    method @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.RESTORE_RUNTIME_PERMISSIONS}) public void stageAndApplyRuntimePermissionsBackup(@NonNull byte[], @NonNull android.os.UserHandle);
    field public static final int COUNT_ONLY_WHEN_GRANTED = 1; // 0x1
    field public static final int COUNT_WHEN_SYSTEM = 2; // 0x2
    field public static final int REASON_INSTALLER_POLICY_VIOLATION = 2; // 0x2
    field public static final int REASON_MALWARE = 1; // 0x1
  }

  public abstract static class PermissionControllerManager.OnRevokeRuntimePermissionsCallback {
    ctor public PermissionControllerManager.OnRevokeRuntimePermissionsCallback();
    method public abstract void onRevokeRuntimePermissions(@NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>);
  }

  public abstract class PermissionControllerService extends android.app.Service {
    ctor public PermissionControllerService();
    method @BinderThread public void onApplyStagedRuntimePermissionBackup(@NonNull String, @NonNull android.os.UserHandle, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @NonNull public final android.os.IBinder onBind(android.content.Intent);
    method @BinderThread public abstract void onCountPermissionApps(@NonNull java.util.List<java.lang.String>, int, @NonNull java.util.function.IntConsumer);
    method @BinderThread public abstract void onGetAppPermissions(@NonNull String, @NonNull java.util.function.Consumer<java.util.List<android.permission.RuntimePermissionPresentationInfo>>);
    method @BinderThread public abstract void onGetPermissionUsages(boolean, long, @NonNull java.util.function.Consumer<java.util.List<android.permission.RuntimePermissionUsageInfo>>);
    method @BinderThread public abstract void onGetRuntimePermissionsBackup(@NonNull android.os.UserHandle, @NonNull java.io.OutputStream, @NonNull Runnable);
    method @BinderThread public abstract void onGrantOrUpgradeDefaultRuntimePermissions(@NonNull Runnable);
    method @BinderThread public void onOneTimePermissionSessionTimeout(@NonNull String);
    method @Deprecated @BinderThread public void onRestoreDelayedRuntimePermissionsBackup(@NonNull String, @NonNull android.os.UserHandle, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @Deprecated @BinderThread public void onRestoreRuntimePermissionsBackup(@NonNull android.os.UserHandle, @NonNull java.io.InputStream, @NonNull Runnable);
    method @BinderThread public abstract void onRevokeRuntimePermission(@NonNull String, @NonNull String, @NonNull Runnable);
    method @BinderThread public abstract void onRevokeRuntimePermissions(@NonNull java.util.Map<java.lang.String,java.util.List<java.lang.String>>, boolean, int, @NonNull String, @NonNull java.util.function.Consumer<java.util.Map<java.lang.String,java.util.List<java.lang.String>>>);
    method @BinderThread public abstract void onSetRuntimePermissionGrantStateByDeviceAdmin(@NonNull String, @NonNull String, @NonNull String, int, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @BinderThread public void onStageAndApplyRuntimePermissionsBackup(@NonNull android.os.UserHandle, @NonNull java.io.InputStream, @NonNull Runnable);
    method @BinderThread public void onUpdateUserSensitivePermissionFlags();
    field public static final String SERVICE_INTERFACE = "android.permission.PermissionControllerService";
  }

  public final class PermissionManager {
    method @IntRange(from=0) @RequiresPermission(anyOf={android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY, "android.permission.UPGRADE_RUNTIME_PERMISSIONS"}) public int getRuntimePermissionsVersion();
    method @NonNull public java.util.List<android.permission.PermissionManager.SplitPermissionInfo> getSplitPermissions();
    method @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS) public void grantDefaultPermissionsToEnabledCarrierApps(@NonNull String[], @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS) public void grantDefaultPermissionsToEnabledImsServices(@NonNull String[], @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS) public void grantDefaultPermissionsToEnabledTelephonyDataServices(@NonNull String[], @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS) public void grantDefaultPermissionsToLuiApp(@NonNull String, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS) public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(@NonNull String[], @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS) public void revokeDefaultPermissionsFromLuiApps(@NonNull String[], @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
    method @RequiresPermission(anyOf={android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY, "android.permission.UPGRADE_RUNTIME_PERMISSIONS"}) public void setRuntimePermissionsVersion(@IntRange(from=0) int);
    method @RequiresPermission(android.Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS) public void startOneTimePermissionSession(@NonNull String, long, int, int);
    method @RequiresPermission(android.Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS) public void stopOneTimePermissionSession(@NonNull String);
  }

  public static final class PermissionManager.SplitPermissionInfo {
    method @NonNull public java.util.List<java.lang.String> getNewPermissions();
    method @NonNull public String getSplitPermission();
    method public int getTargetSdk();
  }

  public final class RuntimePermissionPresentationInfo implements android.os.Parcelable {
    ctor public RuntimePermissionPresentationInfo(@NonNull 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 @NonNull public static final android.os.Parcelable.Creator<android.permission.RuntimePermissionPresentationInfo> CREATOR;
  }

  public final class RuntimePermissionUsageInfo implements android.os.Parcelable {
    ctor public RuntimePermissionUsageInfo(@NonNull String, int);
    method public int describeContents();
    method public int getAppAccessCount();
    method @NonNull public String getName();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.permission.RuntimePermissionUsageInfo> CREATOR;
  }

}

package android.permissionpresenterservice {

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

}

package android.preference {

  @Deprecated public class PreferenceManager {
    method @Deprecated public boolean isStorageCredentialProtected();
    method @Deprecated 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 @NonNull 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 @NonNull 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 class BlockedNumberContract {
    field public static final String METHOD_NOTIFY_EMERGENCY_CONTACT = "notify_emergency_contact";
    field public static final String METHOD_SHOULD_SYSTEM_BLOCK_NUMBER = "should_system_block_number";
    field public static final String RES_BLOCK_STATUS = "block_status";
    field public static final int STATUS_BLOCKED_IN_LIST = 1; // 0x1
    field public static final int STATUS_BLOCKED_NOT_IN_CONTACTS = 5; // 0x5
    field public static final int STATUS_BLOCKED_PAYPHONE = 4; // 0x4
    field public static final int STATUS_BLOCKED_RESTRICTED = 2; // 0x2
    field public static final int STATUS_BLOCKED_UNKNOWN_NUMBER = 3; // 0x3
    field public static final int STATUS_NOT_BLOCKED = 0; // 0x0
  }

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

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

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

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

  public final class DeviceConfig {
    method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static void addOnPropertiesChangedListener(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.provider.DeviceConfig.OnPropertiesChangedListener);
    method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static boolean getBoolean(@NonNull String, @NonNull String, boolean);
    method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static float getFloat(@NonNull String, @NonNull String, float);
    method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static int getInt(@NonNull String, @NonNull String, int);
    method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static long getLong(@NonNull String, @NonNull String, long);
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static android.provider.DeviceConfig.Properties getProperties(@NonNull String, @NonNull java.lang.String...);
    method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static String getProperty(@NonNull String, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public static String getString(@NonNull String, @NonNull String, @Nullable String);
    method public static void removeOnPropertiesChangedListener(@NonNull android.provider.DeviceConfig.OnPropertiesChangedListener);
    method @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static void resetToDefaults(int, @Nullable String);
    method @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static boolean setProperties(@NonNull android.provider.DeviceConfig.Properties) throws android.provider.DeviceConfig.BadConfigException;
    method @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static boolean setProperty(@NonNull String, @NonNull String, @Nullable String, boolean);
    field public static final String NAMESPACE_ACTIVITY_MANAGER = "activity_manager";
    field public static final String NAMESPACE_ACTIVITY_MANAGER_NATIVE_BOOT = "activity_manager_native_boot";
    field public static final String NAMESPACE_APP_COMPAT = "app_compat";
    field public static final String NAMESPACE_ATTENTION_MANAGER_SERVICE = "attention_manager_service";
    field public static final String NAMESPACE_AUTOFILL = "autofill";
    field public static final String NAMESPACE_BIOMETRICS = "biometrics";
    field public static final String NAMESPACE_CONNECTIVITY = "connectivity";
    field public static final String NAMESPACE_CONTENT_CAPTURE = "content_capture";
    field @Deprecated public static final String NAMESPACE_DEX_BOOT = "dex_boot";
    field public static final String NAMESPACE_DISPLAY_MANAGER = "display_manager";
    field public static final String NAMESPACE_GAME_DRIVER = "game_driver";
    field public static final String NAMESPACE_INPUT_NATIVE_BOOT = "input_native_boot";
    field public static final String NAMESPACE_INTELLIGENCE_ATTENTION = "intelligence_attention";
    field public static final String NAMESPACE_MEDIA_NATIVE = "media_native";
    field public static final String NAMESPACE_NETD_NATIVE = "netd_native";
    field public static final String NAMESPACE_PACKAGE_MANAGER_SERVICE = "package_manager_service";
    field public static final String NAMESPACE_PERMISSIONS = "permissions";
    field public static final String NAMESPACE_PRIVACY = "privacy";
    field public static final String NAMESPACE_ROLLBACK = "rollback";
    field public static final String NAMESPACE_ROLLBACK_BOOT = "rollback_boot";
    field public static final String NAMESPACE_RUNTIME = "runtime";
    field public static final String NAMESPACE_RUNTIME_NATIVE = "runtime_native";
    field public static final String NAMESPACE_RUNTIME_NATIVE_BOOT = "runtime_native_boot";
    field public static final String NAMESPACE_SCHEDULER = "scheduler";
    field @Deprecated public static final String NAMESPACE_STORAGE = "storage";
    field public static final String NAMESPACE_STORAGE_NATIVE_BOOT = "storage_native_boot";
    field public static final String NAMESPACE_SYSTEMUI = "systemui";
    field public static final String NAMESPACE_TELEPHONY = "telephony";
    field public static final String NAMESPACE_TEXTCLASSIFIER = "textclassifier";
    field public static final String NAMESPACE_WINDOW_MANAGER_NATIVE_BOOT = "window_manager_native_boot";
  }

  public static class DeviceConfig.BadConfigException extends java.lang.Exception {
    ctor public DeviceConfig.BadConfigException();
  }

  public static interface DeviceConfig.OnPropertiesChangedListener {
    method public void onPropertiesChanged(@NonNull android.provider.DeviceConfig.Properties);
  }

  public static class DeviceConfig.Properties {
    method public boolean getBoolean(@NonNull String, boolean);
    method public float getFloat(@NonNull String, float);
    method public int getInt(@NonNull String, int);
    method @NonNull public java.util.Set<java.lang.String> getKeyset();
    method public long getLong(@NonNull String, long);
    method @NonNull public String getNamespace();
    method @Nullable public String getString(@NonNull String, @Nullable String);
  }

  public static final class DeviceConfig.Properties.Builder {
    ctor public DeviceConfig.Properties.Builder(@NonNull String);
    method @NonNull public android.provider.DeviceConfig.Properties build();
    method @NonNull public android.provider.DeviceConfig.Properties.Builder setBoolean(@NonNull String, boolean);
    method @NonNull public android.provider.DeviceConfig.Properties.Builder setFloat(@NonNull String, float);
    method @NonNull public android.provider.DeviceConfig.Properties.Builder setInt(@NonNull String, int);
    method @NonNull public android.provider.DeviceConfig.Properties.Builder setLong(@NonNull String, long);
    method @NonNull public android.provider.DeviceConfig.Properties.Builder setString(@NonNull String, @Nullable String);
  }

  public final class DocumentsContract {
    method @NonNull public static android.net.Uri buildDocumentUriAsUser(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
    method public static boolean isManageMode(@NonNull android.net.Uri);
    method @NonNull public static android.net.Uri setManageMode(@NonNull android.net.Uri);
    field public static final String ACTION_DOCUMENT_ROOT_SETTINGS = "android.provider.action.DOCUMENT_ROOT_SETTINGS";
    field public static final String ACTION_MANAGE_DOCUMENT = "android.provider.action.MANAGE_DOCUMENT";
    field public static final String EXTRA_SHOW_ADVANCED = "android.provider.extra.SHOW_ADVANCED";
  }

  public static final class DocumentsContract.Root {
    field public static final int FLAG_ADVANCED = 65536; // 0x10000
    field public static final int FLAG_HAS_SETTINGS = 131072; // 0x20000
    field public static final int FLAG_REMOVABLE_SD = 262144; // 0x40000
    field public static final int FLAG_REMOVABLE_USB = 524288; // 0x80000
  }

  public final class MediaStore {
    method @NonNull public static android.net.Uri rewriteToLegacy(@NonNull android.net.Uri);
    method @NonNull public static android.net.Uri scanFile(@NonNull android.content.ContentResolver, @NonNull java.io.File);
    method public static void scanVolume(@NonNull android.content.ContentResolver, @NonNull String);
    method public static void waitForIdle(@NonNull android.content.ContentResolver);
    field public static final String AUTHORITY_LEGACY = "media_legacy";
    field @NonNull public static final android.net.Uri AUTHORITY_LEGACY_URI;
  }

  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 DYNAMIC_INDEXABLES_RAW = "dynamic_indexables_raw";
    field public static final String DYNAMIC_INDEXABLES_RAW_PATH = "settings/dynamic_indexables_raw";
    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";
    field public static final String SLICE_URI_PAIRS = "slice_uri_pairs";
    field @NonNull public static final String[] SLICE_URI_PAIRS_COLUMNS;
    field public static final String SLICE_URI_PAIRS_PATH = "settings/slice_uri_pairs";
  }

  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.SliceUriPairColumns {
    field public static final String KEY = "key";
    field public static final String SLICE_URI = "slice_uri";
  }

  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 @Nullable public android.database.Cursor queryDynamicRawData(@Nullable String[]);
    method public abstract android.database.Cursor queryNonIndexableKeys(String[]);
    method public abstract android.database.Cursor queryRawData(String[]);
    method @Nullable public android.database.Cursor querySliceUriPairs();
    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 {
    method public static boolean checkAndNoteWriteSettingsOperation(@NonNull android.content.Context, int, @NonNull String, boolean);
    field public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS = "android.settings.ACCESSIBILITY_DETAILS_SETTINGS";
    field public static final String ACTION_BUGREPORT_HANDLER_SETTINGS = "android.settings.BUGREPORT_HANDLER_SETTINGS";
    field public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
    field public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS = "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS";
    field public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION = "android.settings.MANAGE_APP_OVERLAY_PERMISSION";
    field public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS";
    field public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS = "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS";
    field public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS = "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS";
    field public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE = "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE";
    field public static final String ACTION_SHOW_ADMIN_SUPPORT_DETAILS = "android.settings.SHOW_ADMIN_SUPPORT_DETAILS";
    field public static final String ACTION_TETHER_PROVISIONING_UI = "android.settings.TETHER_PROVISIONING_UI";
    field public static final String ACTION_TETHER_SETTINGS = "android.settings.TETHER_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 AIRPLANE_MODE_TOGGLEABLE_RADIOS = "airplane_mode_toggleable_radios";
    field public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
    field public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES = "autofill_compat_mode_allowed_packages";
    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 COMMON_CRITERIA_MODE = "common_criteria_mode";
    field public static final String DEFAULT_SM_DP_PLUS = "default_sm_dp_plus";
    field public static final String DEVICE_DEMO_MODE = "device_demo_mode";
    field public static final String DEVICE_PROVISIONING_MOBILE_DATA_ENABLED = "device_provisioning_mobile_data";
    field public static final String EUICC_PROVISIONED = "euicc_provisioned";
    field public static final String EUICC_SUPPORTED_COUNTRIES = "euicc_supported_countries";
    field public static final String EUICC_UNSUPPORTED_COUNTRIES = "euicc_unsupported_countries";
    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 REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt";
    field public static final String TETHER_OFFLOAD_DISABLED = "tether_offload_disabled";
    field public static final String TETHER_SUPPORTED = "tether_supported";
    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 @Deprecated 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 @Deprecated public static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED = "accessibility_display_magnification_navbar_enabled";
    field public static final String ASSIST_GESTURE_SETUP_COMPLETE = "assist_gesture_setup_complete";
    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 AUTO_REVOKE_DISABLED = "auto_revoke_disabled";
    field public static final String CARRIER_APPS_HANDLED = "carrier_apps_handled";
    field public static final String COMPLETED_CATEGORY_PREFIX = "suggested.completed_category.";
    field public static final String DOZE_ALWAYS_ON = "doze_always_on";
    field public static final String HUSH_GESTURE_USED = "hush_gesture_used";
    field public static final String INSTANT_APPS_ENABLED = "instant_apps_enabled";
    field public static final String LAST_SETUP_SHOWN = "last_setup_shown";
    field public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS = "location_access_check_delay_millis";
    field public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS = "location_access_check_interval_millis";
    field public static final int LOCATION_MODE_ON = 3; // 0x3
    field @Deprecated public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE = "location_permissions_upgrade_to_q_mode";
    field public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = "lock_screen_allow_private_notifications";
    field public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = "lock_screen_show_notifications";
    field public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled";
    field public static final String SECURE_FRP_MODE = "secure_frp_mode";
    field public static final String THEME_CUSTOMIZATION_OVERLAY_PACKAGES = "theme_customization_overlay_packages";
    field public static final String USER_SETUP_COMPLETE = "user_setup_complete";
    field public static final int USER_SETUP_PERSONALIZATION_COMPLETE = 10; // 0xa
    field public static final int USER_SETUP_PERSONALIZATION_NOT_STARTED = 0; // 0x0
    field public static final int USER_SETUP_PERSONALIZATION_PAUSED = 2; // 0x2
    field public static final int USER_SETUP_PERSONALIZATION_STARTED = 1; // 0x1
    field public static final String USER_SETUP_PERSONALIZATION_STATE = "user_setup_personalization_state";
    field public static final String VOLUME_HUSH_GESTURE = "volume_hush_gesture";
    field public static final int VOLUME_HUSH_MUTE = 2; // 0x2
    field public static final int VOLUME_HUSH_OFF = 0; // 0x0
    field public static final int VOLUME_HUSH_VIBRATE = 1; // 0x1
  }

  public static final class Settings.System extends android.provider.Settings.NameValueTable {
    method @RequiresPermission(android.Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE) public static boolean putString(@NonNull android.content.ContentResolver, @NonNull String, @Nullable String, boolean);
  }

  public static interface Telephony.CarrierColumns extends android.provider.BaseColumns {
    field @NonNull public static final android.net.Uri CONTENT_URI;
    field public static final String EXPIRATION_TIME = "expiration_time";
    field public static final String KEY_IDENTIFIER = "key_identifier";
    field public static final String KEY_TYPE = "key_type";
    field public static final String LAST_MODIFIED = "last_modified";
    field public static final String MCC = "mcc";
    field public static final String MNC = "mnc";
    field public static final String MVNO_MATCH_DATA = "mvno_match_data";
    field public static final String MVNO_TYPE = "mvno_type";
    field public static final String PUBLIC_KEY = "public_key";
  }

  public static final class Telephony.CarrierId.All implements android.provider.BaseColumns {
    field public static final String APN = "apn";
    field @NonNull public static final android.net.Uri CONTENT_URI;
    field public static final String GID1 = "gid1";
    field public static final String GID2 = "gid2";
    field public static final String ICCID_PREFIX = "iccid_prefix";
    field public static final String IMSI_PREFIX_XPATTERN = "imsi_prefix_xpattern";
    field public static final String MCCMNC = "mccmnc";
    field public static final String PLMN = "plmn";
    field public static final String PRIVILEGE_ACCESS_RULE = "privilege_access_rule";
    field public static final String SPN = "spn";
  }

  public static final class Telephony.Carriers implements android.provider.BaseColumns {
    field public static final String APN_SET_ID = "apn_set_id";
    field @Deprecated public static final String BEARER_BITMASK = "bearer_bitmask";
    field public static final int CARRIER_EDITED = 4; // 0x4
    field @NonNull public static final android.net.Uri DPC_URI;
    field public static final String EDITED_STATUS = "edited";
    field public static final int INVALID_APN_ID = -1; // 0xffffffff
    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 PROFILE_ID = "profile_id";
    field public static final String SKIP_464XLAT = "skip_464xlat";
    field public static final int SKIP_464XLAT_DEFAULT = -1; // 0xffffffff
    field public static final int SKIP_464XLAT_DISABLE = 0; // 0x0
    field public static final int SKIP_464XLAT_ENABLE = 1; // 0x1
    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 static final class Telephony.CellBroadcasts implements android.provider.BaseColumns {
    field @NonNull public static final String AUTHORITY_LEGACY = "cellbroadcast-legacy";
    field @NonNull public static final android.net.Uri AUTHORITY_LEGACY_URI;
    field @NonNull public static final String CALL_METHOD_GET_PREFERENCE = "get_preference";
    field public static final String CID = "cid";
    field public static final String CMAS_CATEGORY = "cmas_category";
    field public static final String CMAS_CERTAINTY = "cmas_certainty";
    field public static final String CMAS_MESSAGE_CLASS = "cmas_message_class";
    field public static final String CMAS_RESPONSE_TYPE = "cmas_response_type";
    field public static final String CMAS_SEVERITY = "cmas_severity";
    field public static final String CMAS_URGENCY = "cmas_urgency";
    field @NonNull public static final android.net.Uri CONTENT_URI;
    field public static final String DATA_CODING_SCHEME = "dcs";
    field public static final String DEFAULT_SORT_ORDER = "date DESC";
    field public static final String DELIVERY_TIME = "date";
    field public static final String ETWS_WARNING_TYPE = "etws_warning_type";
    field public static final String GEOGRAPHICAL_SCOPE = "geo_scope";
    field public static final String GEOMETRIES = "geometries";
    field public static final String LAC = "lac";
    field public static final String LANGUAGE_CODE = "language";
    field public static final String LOCATION_CHECK_TIME = "location_check_time";
    field public static final String MAXIMUM_WAIT_TIME = "maximum_wait_time";
    field public static final String MESSAGE_BODY = "body";
    field public static final String MESSAGE_BROADCASTED = "message_broadcasted";
    field public static final String MESSAGE_DISPLAYED = "message_displayed";
    field public static final String MESSAGE_FORMAT = "format";
    field @NonNull @RequiresPermission(android.Manifest.permission.READ_CELL_BROADCASTS) public static final android.net.Uri MESSAGE_HISTORY_URI;
    field public static final String MESSAGE_PRIORITY = "priority";
    field public static final String MESSAGE_READ = "read";
    field public static final String PLMN = "plmn";
    field public static final String RECEIVED_TIME = "received_time";
    field public static final String SERIAL_NUMBER = "serial_number";
    field public static final String SERVICE_CATEGORY = "service_category";
    field public static final String SLOT_INDEX = "slot_index";
    field public static final String SUBSCRIPTION_ID = "sub_id";
  }

  public static final class Telephony.CellBroadcasts.Preference {
    field @NonNull public static final String ENABLE_ALERT_VIBRATION_PREF = "enable_alert_vibrate";
    field @NonNull public static final String ENABLE_AREA_UPDATE_INFO_PREF = "enable_area_update_info_alerts";
    field @NonNull public static final String ENABLE_CMAS_AMBER_PREF = "enable_cmas_amber_alerts";
    field @NonNull public static final String ENABLE_CMAS_EXTREME_THREAT_PREF = "enable_cmas_extreme_threat_alerts";
    field @NonNull public static final String ENABLE_CMAS_IN_SECOND_LANGUAGE_PREF = "receive_cmas_in_second_language";
    field @NonNull public static final String ENABLE_CMAS_PRESIDENTIAL_PREF = "enable_cmas_presidential_alerts";
    field @NonNull public static final String ENABLE_CMAS_SEVERE_THREAT_PREF = "enable_cmas_severe_threat_alerts";
    field @NonNull public static final String ENABLE_EMERGENCY_PERF = "enable_emergency_alerts";
    field @NonNull public static final String ENABLE_PUBLIC_SAFETY_PREF = "enable_public_safety_messages";
    field @NonNull public static final String ENABLE_STATE_LOCAL_TEST_PREF = "enable_state_local_test_alerts";
    field @NonNull public static final String ENABLE_TEST_ALERT_PREF = "enable_test_alerts";
  }

  public static final class Telephony.SimInfo {
    field public static final String ACCESS_RULES = "access_rules";
    field public static final String ACCESS_RULES_FROM_CARRIER_CONFIGS = "access_rules_from_carrier_configs";
    field public static final String ALLOWED_NETWORK_TYPES = "allowed_network_types";
    field public static final String CARD_ID = "card_id";
    field public static final String CARRIER_ID = "carrier_id";
    field public static final String CARRIER_NAME = "carrier_name";
    field public static final String CB_ALERT_REMINDER_INTERVAL = "alert_reminder_interval";
    field public static final String CB_ALERT_SOUND_DURATION = "alert_sound_duration";
    field public static final String CB_ALERT_SPEECH = "enable_alert_speech";
    field public static final String CB_ALERT_VIBRATE = "enable_alert_vibrate";
    field public static final String CB_AMBER_ALERT = "enable_cmas_amber_alerts";
    field public static final String CB_CHANNEL_50_ALERT = "enable_channel_50_alerts";
    field public static final String CB_CMAS_TEST_ALERT = "enable_cmas_test_alerts";
    field public static final String CB_EMERGENCY_ALERT = "enable_emergency_alerts";
    field public static final String CB_ETWS_TEST_ALERT = "enable_etws_test_alerts";
    field public static final String CB_EXTREME_THREAT_ALERT = "enable_cmas_extreme_threat_alerts";
    field public static final String CB_OPT_OUT_DIALOG = "show_cmas_opt_out_dialog";
    field public static final String CB_SEVERE_THREAT_ALERT = "enable_cmas_severe_threat_alerts";
    field public static final String COLOR = "color";
    field @NonNull public static final android.net.Uri CONTENT_URI;
    field public static final String DATA_ENABLED_OVERRIDE_RULES = "data_enabled_override_rules";
    field public static final String DATA_ROAMING = "data_roaming";
    field public static final int DATA_ROAMING_DEFAULT = 0; // 0x0
    field public static final int DATA_ROAMING_DISABLE = 0; // 0x0
    field public static final int DATA_ROAMING_ENABLE = 1; // 0x1
    field public static final String DISPLAY_NAME = "display_name";
    field public static final String EHPLMNS = "ehplmns";
    field public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
    field public static final String GROUP_OWNER = "group_owner";
    field public static final String GROUP_UUID = "group_uuid";
    field public static final String HPLMNS = "hplmns";
    field public static final String ICC_ID = "icc_id";
    field public static final String IMSI = "imsi";
    field public static final String IMS_RCS_UCE_ENABLED = "ims_rcs_uce_enabled";
    field public static final String ISO_COUNTRY_CODE = "iso_country_code";
    field public static final String IS_EMBEDDED = "is_embedded";
    field public static final String IS_OPPORTUNISTIC = "is_opportunistic";
    field public static final String IS_REMOVABLE = "is_removable";
    field public static final String MCC = "mcc";
    field public static final String MCC_STRING = "mcc_string";
    field public static final String MNC = "mnc";
    field public static final String MNC_STRING = "mnc_string";
    field public static final String NAME_SOURCE = "name_source";
    field public static final int NAME_SOURCE_CARRIER = 3; // 0x3
    field public static final int NAME_SOURCE_DEFAULT = 0; // 0x0
    field public static final int NAME_SOURCE_SIM_PNN = 4; // 0x4
    field public static final int NAME_SOURCE_SIM_SPN = 1; // 0x1
    field public static final int NAME_SOURCE_USER_INPUT = 2; // 0x2
    field public static final String NUMBER = "number";
    field public static final String PROFILE_CLASS = "profile_class";
    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 public static final int SIM_NOT_INSERTED = -1; // 0xffffffff
    field public static final String SIM_SLOT_INDEX = "sim_id";
    field public static final String SUBSCRIPTION_TYPE = "subscription_type";
    field public static final int SUBSCRIPTION_TYPE_LOCAL_SIM = 0; // 0x0
    field public static final int SUBSCRIPTION_TYPE_REMOTE_SIM = 1; // 0x1
    field public static final String UICC_APPLICATIONS_ENABLED = "uicc_applications_enabled";
    field public static final String UNIQUE_KEY_SUBSCRIPTION_ID = "_id";
    field public static final String VT_IMS_ENABLED = "vt_ims_enabled";
    field public static final String WFC_IMS_ENABLED = "wfc_ims_enabled";
    field public static final String WFC_IMS_MODE = "wfc_ims_mode";
    field public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled";
    field public static final String WFC_IMS_ROAMING_MODE = "wfc_ims_roaming_mode";
  }

  public static final class Telephony.Sms.Intents {
    field public static final String ACTION_SMS_EMERGENCY_CB_RECEIVED = "android.provider.action.SMS_EMERGENCY_CB_RECEIVED";
  }

  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.se.omapi {

  public final class Reader {
    method @RequiresPermission(android.Manifest.permission.SECURE_ELEMENT_PRIVILEGED) public boolean reset();
  }

}

package android.security.keystore {

  public class AndroidKeyStoreProvider extends java.security.Provider {
    method @NonNull public static java.security.KeyStore getKeyStoreForUid(int) throws java.security.KeyStoreException, java.security.NoSuchProviderException;
  }

  public abstract class AttestationUtils {
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) 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
    field public static final int USE_INDIVIDUAL_ATTESTATION = 4; // 0x4
  }

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

  public static final class KeyGenParameterSpec.Builder {
    method @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setUid(int);
  }

}

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 @NonNull 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 @NonNull public android.security.keystore.recovery.KeyChainProtectionParams.Builder setKeyDerivationParams(@NonNull android.security.keystore.recovery.KeyDerivationParams);
    method @NonNull public android.security.keystore.recovery.KeyChainProtectionParams.Builder setLockScreenUiFormat(int);
    method @NonNull public android.security.keystore.recovery.KeyChainProtectionParams.Builder setSecret(@NonNull byte[]);
    method @NonNull 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 @NonNull 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 @NonNull 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 @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public android.security.keystore.recovery.RecoverySession createRecoverySession();
    method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.security.Key generateKey(@NonNull String) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
    method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.security.Key generateKey(@NonNull String, @Nullable byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
    method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.util.List<java.lang.String> getAliases() throws android.security.keystore.recovery.InternalRecoveryServiceException;
    method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public static android.security.keystore.recovery.RecoveryController getInstance(@NonNull android.content.Context);
    method @Nullable @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.security.Key getKey(@NonNull String) throws android.security.keystore.recovery.InternalRecoveryServiceException, java.security.UnrecoverableKeyException;
    method @Nullable @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) 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 @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.util.Map<java.lang.String,java.security.cert.X509Certificate> getRootCertificates();
    method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.security.Key importKey(@NonNull String, @NonNull byte[]) throws android.security.keystore.recovery.InternalRecoveryServiceException, android.security.keystore.recovery.LockScreenRequiredException;
    method @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) public java.security.Key importKey(@NonNull String, @NonNull byte[], @Nullable 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 @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) 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 @NonNull @RequiresPermission(android.Manifest.permission.RECOVER_KEYSTORE) 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 @Nullable public byte[] getMetadata();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull 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 @NonNull public android.security.keystore.recovery.WrappedApplicationKey.Builder setAlias(@NonNull String);
    method @NonNull public android.security.keystore.recovery.WrappedApplicationKey.Builder setEncryptedKeyMaterial(@NonNull byte[]);
    method @NonNull public android.security.keystore.recovery.WrappedApplicationKey.Builder setMetadata(@Nullable byte[]);
  }

}

package android.service.appprediction {

  public abstract class AppPredictionService extends android.app.Service {
    ctor public AppPredictionService();
    method @MainThread public abstract void onAppTargetEvent(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull android.app.prediction.AppTargetEvent);
    method @NonNull public final android.os.IBinder onBind(@NonNull android.content.Intent);
    method public void onCreatePredictionSession(@NonNull android.app.prediction.AppPredictionContext, @NonNull android.app.prediction.AppPredictionSessionId);
    method @MainThread public void onDestroyPredictionSession(@NonNull android.app.prediction.AppPredictionSessionId);
    method @MainThread public abstract void onLaunchLocationShown(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull String, @NonNull java.util.List<android.app.prediction.AppTargetId>);
    method @MainThread public abstract void onRequestPredictionUpdate(@NonNull android.app.prediction.AppPredictionSessionId);
    method @MainThread public abstract void onSortAppTargets(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull java.util.List<android.app.prediction.AppTarget>, @NonNull android.os.CancellationSignal, @NonNull java.util.function.Consumer<java.util.List<android.app.prediction.AppTarget>>);
    method @MainThread public void onStartPredictionUpdates();
    method @MainThread public void onStopPredictionUpdates();
    method public final void updatePredictions(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull java.util.List<android.app.prediction.AppTarget>);
  }

}

package android.service.attention {

  public abstract class AttentionService extends android.app.Service {
    ctor public AttentionService();
    method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
    method public abstract void onCancelAttentionCheck(@NonNull android.service.attention.AttentionService.AttentionCallback);
    method public abstract void onCheckAttention(@NonNull android.service.attention.AttentionService.AttentionCallback);
    field public static final int ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6; // 0x6
    field public static final int ATTENTION_FAILURE_CANCELLED = 3; // 0x3
    field public static final int ATTENTION_FAILURE_PREEMPTED = 4; // 0x4
    field public static final int ATTENTION_FAILURE_TIMED_OUT = 5; // 0x5
    field public static final int ATTENTION_FAILURE_UNKNOWN = 2; // 0x2
    field public static final int ATTENTION_SUCCESS_ABSENT = 0; // 0x0
    field public static final int ATTENTION_SUCCESS_PRESENT = 1; // 0x1
    field public static final String SERVICE_INTERFACE = "android.service.attention.AttentionService";
  }

  public static final class AttentionService.AttentionCallback {
    method public void onFailure(int);
    method public void onSuccess(int, long);
  }

}

package android.service.autofill {

  public abstract class AutofillFieldClassificationService extends android.app.Service {
    ctor public AutofillFieldClassificationService();
    method public android.os.IBinder onBind(android.content.Intent);
    method @Nullable public float[][] onCalculateScores(@NonNull java.util.List<android.view.autofill.AutofillValue>, @NonNull java.util.List<java.lang.String>, @NonNull java.util.List<java.lang.String>, @Nullable String, @Nullable android.os.Bundle, @Nullable java.util.Map, @Nullable java.util.Map);
    method @Deprecated @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 REQUIRED_ALGORITHM_CREDIT_CARD = "CREDIT_CARD";
    field public static final String REQUIRED_ALGORITHM_EDIT_DISTANCE = "EDIT_DISTANCE";
    field public static final String REQUIRED_ALGORITHM_EXACT_MATCH = "EXACT_MATCH";
    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";
  }

  public static final class Dataset.Builder {
    ctor public Dataset.Builder(@NonNull android.service.autofill.InlinePresentation);
    method @NonNull public android.service.autofill.Dataset.Builder setInlinePresentation(@NonNull android.view.autofill.AutofillId, @Nullable android.view.autofill.AutofillValue, @Nullable java.util.regex.Pattern, @NonNull android.service.autofill.InlinePresentation);
  }

  public abstract class InlineSuggestionRenderService extends android.app.Service {
    ctor public InlineSuggestionRenderService();
    method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
    method @Nullable public android.os.Bundle onGetInlineSuggestionsRendererInfo();
    method @Nullable public android.view.View onRenderSuggestion(@NonNull android.service.autofill.InlinePresentation, int, int);
    field public static final String SERVICE_INTERFACE = "android.service.autofill.InlineSuggestionRenderService";
  }

}

package android.service.autofill.augmented {

  public abstract class AugmentedAutofillService extends android.app.Service {
    ctor public AugmentedAutofillService();
    method protected final void dump(java.io.FileDescriptor, java.io.PrintWriter, String[]);
    method protected void dump(@NonNull java.io.PrintWriter, @NonNull String[]);
    method @Nullable public final android.service.autofill.FillEventHistory getFillEventHistory();
    method public void onConnected();
    method public void onDisconnected();
    method public void onFillRequest(@NonNull android.service.autofill.augmented.FillRequest, @NonNull android.os.CancellationSignal, @NonNull android.service.autofill.augmented.FillController, @NonNull android.service.autofill.augmented.FillCallback);
    method public final boolean requestAutofill(@NonNull android.content.ComponentName, @NonNull android.view.autofill.AutofillId);
    field public static final String SERVICE_INTERFACE = "android.service.autofill.augmented.AugmentedAutofillService";
  }

  public final class FillCallback {
    method public void onSuccess(@Nullable android.service.autofill.augmented.FillResponse);
  }

  public final class FillController {
    method public void autofill(@NonNull java.util.List<android.util.Pair<android.view.autofill.AutofillId,android.view.autofill.AutofillValue>>);
  }

  public final class FillRequest {
    method @NonNull public android.content.ComponentName getActivityComponent();
    method @NonNull public android.view.autofill.AutofillId getFocusedId();
    method @NonNull public android.view.autofill.AutofillValue getFocusedValue();
    method @Nullable public android.view.inputmethod.InlineSuggestionsRequest getInlineSuggestionsRequest();
    method @Nullable public android.service.autofill.augmented.PresentationParams getPresentationParams();
    method public int getTaskId();
  }

  public final class FillResponse {
  }

  public static final class FillResponse.Builder {
    ctor public FillResponse.Builder();
    method @NonNull public android.service.autofill.augmented.FillResponse build();
    method @NonNull public android.service.autofill.augmented.FillResponse.Builder setClientState(@Nullable android.os.Bundle);
    method @NonNull public android.service.autofill.augmented.FillResponse.Builder setFillWindow(@Nullable android.service.autofill.augmented.FillWindow);
    method @NonNull public android.service.autofill.augmented.FillResponse.Builder setInlineSuggestions(@Nullable java.util.List<android.service.autofill.Dataset>);
  }

  public final class FillWindow implements java.lang.AutoCloseable {
    ctor public FillWindow();
    method public void destroy();
    method public boolean update(@NonNull android.service.autofill.augmented.PresentationParams.Area, @NonNull android.view.View, long);
  }

  public abstract class PresentationParams {
    method @Nullable public android.service.autofill.augmented.PresentationParams.Area getSuggestionArea();
  }

  public abstract static class PresentationParams.Area {
    method @NonNull public android.graphics.Rect getBounds();
  }

}

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 @NonNull @WorkerThread public abstract java.util.List<android.content.ContentValues> onRestoreApns(int);
  }

  public abstract class CarrierMessagingServiceWrapper {
    ctor public CarrierMessagingServiceWrapper();
    method public boolean bindToCarrierMessagingService(@NonNull android.content.Context, @NonNull String);
    method public void disposeConnection(@NonNull android.content.Context);
    method public void downloadMms(@NonNull android.net.Uri, int, @NonNull android.net.Uri, @NonNull android.service.carrier.CarrierMessagingServiceWrapper.CarrierMessagingCallbackWrapper);
    method public void filterSms(@NonNull android.service.carrier.MessagePdu, @NonNull String, int, int, @NonNull android.service.carrier.CarrierMessagingServiceWrapper.CarrierMessagingCallbackWrapper);
    method public abstract void onServiceReady();
    method public void sendDataSms(@NonNull byte[], int, @NonNull String, int, int, @NonNull android.service.carrier.CarrierMessagingServiceWrapper.CarrierMessagingCallbackWrapper);
    method public void sendMms(@NonNull android.net.Uri, int, @NonNull android.net.Uri, @NonNull android.service.carrier.CarrierMessagingServiceWrapper.CarrierMessagingCallbackWrapper);
    method public void sendMultipartTextSms(@NonNull java.util.List<java.lang.String>, int, @NonNull String, int, @NonNull android.service.carrier.CarrierMessagingServiceWrapper.CarrierMessagingCallbackWrapper);
    method public void sendTextSms(@NonNull String, int, @NonNull String, int, @NonNull android.service.carrier.CarrierMessagingServiceWrapper.CarrierMessagingCallbackWrapper);
  }

  public abstract static class CarrierMessagingServiceWrapper.CarrierMessagingCallbackWrapper {
    ctor public CarrierMessagingServiceWrapper.CarrierMessagingCallbackWrapper();
    method public void onDownloadMmsComplete(int);
    method public void onFilterComplete(int);
    method public void onSendMmsComplete(int, @Nullable byte[]);
    method public void onSendMultipartSmsComplete(int, @Nullable int[]);
    method public void onSendSmsComplete(int, int);
  }

}

package android.service.contentcapture {

  public final class ActivityEvent implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.content.ComponentName getComponentName();
    method public int getEventType();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.service.contentcapture.ActivityEvent> CREATOR;
    field public static final int TYPE_ACTIVITY_DESTROYED = 24; // 0x18
    field public static final int TYPE_ACTIVITY_PAUSED = 2; // 0x2
    field public static final int TYPE_ACTIVITY_RESUMED = 1; // 0x1
    field public static final int TYPE_ACTIVITY_STOPPED = 23; // 0x17
  }

  public abstract class ContentCaptureService extends android.app.Service {
    ctor public ContentCaptureService();
    method public final void disableSelf();
    method public void onActivityEvent(@NonNull android.service.contentcapture.ActivityEvent);
    method public void onActivitySnapshot(@NonNull android.view.contentcapture.ContentCaptureSessionId, @NonNull android.service.contentcapture.SnapshotData);
    method public void onConnected();
    method public void onContentCaptureEvent(@NonNull android.view.contentcapture.ContentCaptureSessionId, @NonNull android.view.contentcapture.ContentCaptureEvent);
    method public void onCreateContentCaptureSession(@NonNull android.view.contentcapture.ContentCaptureContext, @NonNull android.view.contentcapture.ContentCaptureSessionId);
    method public void onDataRemovalRequest(@NonNull android.view.contentcapture.DataRemovalRequest);
    method public void onDataShareRequest(@NonNull android.view.contentcapture.DataShareRequest, @NonNull android.service.contentcapture.DataShareCallback);
    method public void onDestroyContentCaptureSession(@NonNull android.view.contentcapture.ContentCaptureSessionId);
    method public void onDisconnected();
    method public final void setContentCaptureConditions(@NonNull String, @Nullable java.util.Set<android.view.contentcapture.ContentCaptureCondition>);
    method public final void setContentCaptureWhitelist(@Nullable java.util.Set<java.lang.String>, @Nullable java.util.Set<android.content.ComponentName>);
    field public static final String SERVICE_INTERFACE = "android.service.contentcapture.ContentCaptureService";
    field public static final String SERVICE_META_DATA = "android.content_capture";
  }

  public interface DataShareCallback {
    method public void onAccept(@NonNull java.util.concurrent.Executor, @NonNull android.service.contentcapture.DataShareReadAdapter);
    method public void onReject();
  }

  public interface DataShareReadAdapter {
    method public void onError(int);
    method public void onStart(@NonNull android.os.ParcelFileDescriptor);
  }

  public final class SnapshotData implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.app.assist.AssistContent getAssistContent();
    method @NonNull public android.os.Bundle getAssistData();
    method @NonNull public android.app.assist.AssistStructure getAssistStructure();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.service.contentcapture.SnapshotData> CREATOR;
  }

}

package android.service.contentsuggestions {

  public abstract class ContentSuggestionsService extends android.app.Service {
    ctor public ContentSuggestionsService();
    method public abstract void onClassifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback);
    method public abstract void onNotifyInteraction(@NonNull String, @NonNull android.os.Bundle);
    method public abstract void onProcessContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle);
    method public abstract void onSuggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback);
    field public static final String SERVICE_INTERFACE = "android.service.contentsuggestions.ContentSuggestionsService";
  }

}

package android.service.dataloader {

  public abstract class DataLoaderService extends android.app.Service {
    ctor public DataLoaderService();
    method @Nullable public android.service.dataloader.DataLoaderService.DataLoader onCreateDataLoader(@NonNull android.content.pm.DataLoaderParams);
  }

  public static interface DataLoaderService.DataLoader {
    method public boolean onCreate(@NonNull android.content.pm.DataLoaderParams, @NonNull android.service.dataloader.DataLoaderService.FileSystemConnector);
    method public boolean onPrepareImage(@NonNull java.util.Collection<android.content.pm.InstallationFile>, @NonNull java.util.Collection<java.lang.String>);
  }

  public static final class DataLoaderService.FileSystemConnector {
    method public void writeData(@NonNull String, long, long, @NonNull android.os.ParcelFileDescriptor) throws java.io.IOException;
  }

}

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 @NonNull 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 @NonNull 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>);
  }

  @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}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccProfileInfo.PolicyRule {
  }

  @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}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccProfileInfo.ProfileClass {
  }

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

  public abstract class EuiccService extends android.app.Service {
    ctor public EuiccService();
    method public void dump(@NonNull java.io.PrintWriter);
    method public int encodeSmdxSubjectAndReasonCode(@Nullable String, @Nullable String) throws java.lang.IllegalArgumentException, java.lang.NumberFormatException, java.lang.UnsupportedOperationException;
    method @CallSuper public android.os.IBinder onBind(android.content.Intent);
    method public abstract int onDeleteSubscription(int, String);
    method public 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 @Deprecated public abstract int onEraseSubscriptions(int);
    method public int onEraseSubscriptions(int, @android.telephony.euicc.EuiccCardManager.ResetOption 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_BIND_CARRIER_PROVISIONING_SERVICE = "android.service.euicc.action.BIND_CARRIER_PROVISIONING_SERVICE";
    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_START_CARRIER_ACTIVATION = "android.service.euicc.action.START_CARRIER_ACTIVATION";
    field public static final String ACTION_START_EUICC_ACTIVATION = "android.service.euicc.action.START_EUICC_ACTIVATION";
    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_CARD_ID = "android.service.euicc.extra.RESOLUTION_CARD_ID";
    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 @NonNull 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 @NonNull 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 @NonNull 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 public Adjustment(@NonNull String, @NonNull String, @NonNull android.os.Bundle, @NonNull CharSequence, @NonNull android.os.UserHandle);
    ctor protected Adjustment(android.os.Parcel);
    method public int describeContents();
    method @NonNull public CharSequence getExplanation();
    method @NonNull public String getKey();
    method @NonNull public String getPackage();
    method @NonNull public android.os.Bundle getSignals();
    method public int getUser();
    method @NonNull public android.os.UserHandle getUserHandle();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.service.notification.Adjustment> CREATOR;
    field public static final String KEY_CONTEXTUAL_ACTIONS = "key_contextual_actions";
    field public static final String KEY_IMPORTANCE = "key_importance";
    field public static final String KEY_NOT_CONVERSATION = "key_not_conversation";
    field public static final String KEY_PEOPLE = "key_people";
    field public static final String KEY_RANKING_SCORE = "key_ranking_score";
    field public static final String KEY_SNOOZE_CRITERIA = "key_snooze_criteria";
    field public static final String KEY_TEXT_REPLIES = "key_text_replies";
    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(@NonNull android.service.notification.Adjustment);
    method public final void adjustNotifications(@NonNull java.util.List<android.service.notification.Adjustment>);
    method public void onActionInvoked(@NonNull String, @NonNull android.app.Notification.Action, int);
    method public void onAllowedAdjustmentsChanged();
    method @NonNull public final android.os.IBinder onBind(@Nullable android.content.Intent);
    method public void onNotificationDirectReplied(@NonNull String);
    method @Nullable public abstract android.service.notification.Adjustment onNotificationEnqueued(@NonNull android.service.notification.StatusBarNotification);
    method @Nullable public android.service.notification.Adjustment onNotificationEnqueued(@NonNull android.service.notification.StatusBarNotification, @NonNull android.app.NotificationChannel);
    method public void onNotificationExpansionChanged(@NonNull String, boolean, boolean);
    method public abstract void onNotificationSnoozedUntilContext(@NonNull android.service.notification.StatusBarNotification, @NonNull String);
    method public void onNotificationVisibilityChanged(@NonNull String, boolean);
    method public void onNotificationsSeen(@NonNull java.util.List<java.lang.String>);
    method public void onPanelHidden();
    method public void onPanelRevealed(int);
    method public void onSuggestedReplySent(@NonNull String, @NonNull CharSequence, int);
    method public final void unsnoozeNotification(@NonNull String);
    field public static final String SERVICE_INTERFACE = "android.service.notification.NotificationAssistantService";
    field public static final int SOURCE_FROM_APP = 0; // 0x0
    field public static final int SOURCE_FROM_ASSISTANT = 1; // 0x1
  }

  public abstract class NotificationListenerService extends android.app.Service {
    method public void onNotificationRemoved(@NonNull android.service.notification.StatusBarNotification, @NonNull android.service.notification.NotificationListenerService.RankingMap, @NonNull android.service.notification.NotificationStats, int);
  }

  public final class NotificationStats implements android.os.Parcelable {
    ctor public NotificationStats();
    ctor protected NotificationStats(android.os.Parcel);
    method public int describeContents();
    method public int getDismissalSentiment();
    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 setDismissalSentiment(int);
    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 @NonNull 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
    field public static final int DISMISS_SENTIMENT_NEGATIVE = 0; // 0x0
    field public static final int DISMISS_SENTIMENT_NEUTRAL = 1; // 0x1
    field public static final int DISMISS_SENTIMENT_POSITIVE = 2; // 0x2
    field public static final int DISMISS_SENTIMENT_UNKNOWN = -1000; // 0xfffffc18
  }

  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 @NonNull public static final android.os.Parcelable.Creator<android.service.notification.SnoozeCriterion> CREATOR;
  }

}

package android.service.oemlock {

  public class OemLockManager {
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_CARRIER_OEM_UNLOCK_STATE) public String getLockName();
    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 @android.service.persistentdata.PersistentDataBlockManager.FlashLockState @RequiresPermission(anyOf={android.Manifest.permission.READ_OEM_UNLOCK_STATE, "android.permission.OEM_UNLOCK_STATE"}) 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 @NonNull 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 @NonNull 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.storage {

  public abstract class ExternalStorageService extends android.app.Service {
    ctor public ExternalStorageService();
    method @NonNull public final android.os.IBinder onBind(@NonNull android.content.Intent);
    method public abstract void onEndSession(@NonNull String) throws java.io.IOException;
    method public abstract void onStartSession(@NonNull String, int, @NonNull android.os.ParcelFileDescriptor, @NonNull String, @NonNull String) throws java.io.IOException;
    field public static final int FLAG_SESSION_ATTRIBUTE_INDEXABLE = 2; // 0x2
    field public static final int FLAG_SESSION_TYPE_FUSE = 1; // 0x1
    field public static final String SERVICE_INTERFACE = "android.service.storage.ExternalStorageService";
  }

}

package android.service.textclassifier {

  public abstract class TextClassifierService extends android.app.Service {
    ctor public TextClassifierService();
    method @NonNull public static android.view.textclassifier.TextClassifier getDefaultTextClassifierImplementation(@NonNull android.content.Context);
    method @Deprecated public final android.view.textclassifier.TextClassifier getLocalTextClassifier();
    method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
    method @MainThread 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 onConnected();
    method @MainThread public void onCreateTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationContext, @NonNull android.view.textclassifier.TextClassificationSessionId);
    method @MainThread public void onDestroyTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationSessionId);
    method @MainThread public void onDetectLanguage(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextLanguage.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.TextLanguage>);
    method public void onDisconnected();
    method @MainThread 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 @Deprecated @MainThread public void onSelectionEvent(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.SelectionEvent);
    method @MainThread public void onSuggestConversationActions(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.ConversationActions.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.ConversationActions>);
    method @MainThread 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>);
    method @MainThread public void onTextClassifierEvent(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextClassifierEvent);
    field public static final String SERVICE_INTERFACE = "android.service.textclassifier.TextClassifierService";
  }

  public static interface TextClassifierService.Callback<T> {
    method public void onFailure(@NonNull 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.service.voice {

  public class VoiceInteractionService extends android.app.Service {
    method @NonNull @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public final android.media.voice.KeyphraseModelManager createKeyphraseModelManager();
  }

}

package android.service.wallpaper {

  public class WallpaperService.Engine {
    method public boolean isInAmbientMode();
    method public void onAmbientModeChanged(boolean, long);
  }

}

package android.service.watchdog {

  public abstract class ExplicitHealthCheckService extends android.app.Service {
    ctor public ExplicitHealthCheckService();
    method public final void notifyHealthCheckPassed(@NonNull String);
    method @NonNull public final android.os.IBinder onBind(@NonNull android.content.Intent);
    method public abstract void onCancelHealthCheck(@NonNull String);
    method @NonNull public abstract java.util.List<java.lang.String> onGetRequestedPackages();
    method @NonNull public abstract java.util.List<android.service.watchdog.ExplicitHealthCheckService.PackageConfig> onGetSupportedPackages();
    method public abstract void onRequestHealthCheck(@NonNull String);
    field public static final String BIND_PERMISSION = "android.permission.BIND_EXPLICIT_HEALTH_CHECK_SERVICE";
    field public static final String SERVICE_INTERFACE = "android.service.watchdog.ExplicitHealthCheckService";
  }

  public static final class ExplicitHealthCheckService.PackageConfig implements android.os.Parcelable {
    ctor public ExplicitHealthCheckService.PackageConfig(@NonNull String, long);
    method public int describeContents();
    method public long getHealthCheckTimeoutMillis();
    method @NonNull public String getPackageName();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.service.watchdog.ExplicitHealthCheckService.PackageConfig> CREATOR;
  }

}

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 @NonNull 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 public void enterBackgroundAudioProcessing();
    method public void exitBackgroundAudioProcessing(boolean);
    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 static class CallScreeningService.CallResponse.Builder {
    method @NonNull public android.telecom.CallScreeningService.CallResponse.Builder setShouldScreenCallViaAudioProcessing(boolean);
  }

  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 @NonNull public final String getTelecomCallId();
    method @Deprecated public void onAudioStateChanged(android.telecom.AudioState);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public final void setAddress(@NonNull android.net.Uri, int);
    method public final void setCallerDisplayName(@NonNull String, int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setConferenceState(boolean);
    method @Deprecated public final void setConnectTimeMillis(long);
  }

  public abstract class Connection extends android.telecom.Conferenceable {
    method @Deprecated public final android.telecom.AudioState getAudioState();
    method @IntRange(from=0) public final long getConnectTimeMillis();
    method public final long getConnectionStartElapsedRealtimeMillis();
    method @Nullable public android.telecom.PhoneAccountHandle getPhoneAccountHandle();
    method @Nullable public final String getTelecomCallId();
    method @Deprecated public void onAudioStateChanged(android.telecom.AudioState);
    method public final void resetConnectionTime();
    method public void setCallDirection(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public final void setConnectTimeMillis(@IntRange(from=0) long);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public final void setConnectionStartElapsedRealtimeMillis(long);
    method public void setPhoneAccountHandle(@NonNull android.telecom.PhoneAccountHandle);
    method public void setTelecomCallId(@NonNull String);
    field public static final int CAPABILITY_CONFERENCE_HAS_NO_CHILDREN = 2097152; // 0x200000
    field public static final int CAPABILITY_SPEED_UP_MT_AUDIO = 262144; // 0x40000
    field public static final String EXTRA_DISABLE_ADD_CALL = "android.telecom.extra.DISABLE_ADD_CALL";
    field public static final int PROPERTY_EMERGENCY_CALLBACK_MODE = 1; // 0x1
    field public static final int PROPERTY_GENERIC_CONFERENCE = 2; // 0x2
    field public static final int PROPERTY_IS_DOWNGRADED_CONFERENCE = 64; // 0x40
    field public static final int PROPERTY_REMOTELY_HOSTED = 2048; // 0x800
  }

  public final class ConnectionRequest implements android.os.Parcelable {
    method @Nullable public String getTelecomCallId();
  }

  public abstract class ConnectionService extends android.app.Service {
    method public final void addExistingConnection(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.Connection, @NonNull android.telecom.Conference);
  }

  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 @NonNull 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 @NonNull 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 @NonNull 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_EMERGENCY_CALLS_ONLY = 128; // 0x80
    field public static final int CAPABILITY_EMERGENCY_PREFERRED = 8192; // 0x2000
    field public static final int CAPABILITY_EMERGENCY_VIDEO_CALLING = 512; // 0x200
    field public static final int CAPABILITY_MULTI_USER = 32; // 0x20
    field public static final String EXTRA_ALWAYS_USE_VOIP_AUDIO_MODE = "android.telecom.extra.ALWAYS_USE_VOIP_AUDIO_MODE";
    field public static final String EXTRA_PLAY_CALL_RECORDING_TONE = "android.telecom.extra.PLAY_CALL_RECORDING_TONE";
    field public static final String EXTRA_SORT_ORDER = "android.telecom.extra.SORT_ORDER";
    field public static final String EXTRA_SUPPORTS_VIDEO_CALLING_FALLBACK = "android.telecom.extra.SUPPORTS_VIDEO_CALLING_FALLBACK";
  }

  public static class PhoneAccount.Builder {
    method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telecom.PhoneAccount.Builder setGroupId(@NonNull String);
  }

  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 @NonNull 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 @NonNull 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 @NonNull public android.content.Intent createLaunchEmergencyDialerIntent(@Nullable String);
    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 @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<android.telecom.PhoneAccountHandle> getCallCapablePhoneAccounts(boolean);
    method public int getCallState();
    method public android.telecom.PhoneAccountHandle getConnectionManager();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCurrentTtyMode();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDefaultDialerPackage(@NonNull android.os.UserHandle);
    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 @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUserSelectedOutgoingPhoneAccount(@Nullable android.telecom.PhoneAccountHandle);
    field public static final String ACTION_CURRENT_TTY_MODE_CHANGED = "android.telecom.action.CURRENT_TTY_MODE_CHANGED";
    field public static final String ACTION_TTY_PREFERRED_MODE_CHANGED = "android.telecom.action.TTY_PREFERRED_MODE_CHANGED";
    field public static final int CALL_SOURCE_EMERGENCY_DIALPAD = 1; // 0x1
    field public static final int CALL_SOURCE_EMERGENCY_SHORTCUT = 2; // 0x2
    field public static final int CALL_SOURCE_UNSPECIFIED = 0; // 0x0
    field public static final String EXTRA_CALL_BACK_INTENT = "android.telecom.extra.CALL_BACK_INTENT";
    field public static final String EXTRA_CALL_SOURCE = "android.telecom.extra.CALL_SOURCE";
    field public static final String EXTRA_CALL_TECHNOLOGY_TYPE = "android.telecom.extra.CALL_TECHNOLOGY_TYPE";
    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_CURRENT_TTY_MODE = "android.telecom.extra.CURRENT_TTY_MODE";
    field public static final String EXTRA_IS_USER_INTENT_EMERGENCY_CALL = "android.telecom.extra.IS_USER_INTENT_EMERGENCY_CALL";
    field public static final String EXTRA_TTY_PREFERRED_MODE = "android.telecom.extra.TTY_PREFERRED_MODE";
    field public static final String EXTRA_UNKNOWN_CALL_HANDLE = "android.telecom.extra.UNKNOWN_CALL_HANDLE";
    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 final class AccessNetworkConstants {
    field public static final int TRANSPORT_TYPE_INVALID = -1; // 0xffffffff
  }

  public static final class AccessNetworkConstants.NgranBands {
    method public static int getFrequencyRangeGroup(int);
    field public static final int FREQUENCY_RANGE_GROUP_1 = 1; // 0x1
    field public static final int FREQUENCY_RANGE_GROUP_2 = 2; // 0x2
    field public static final int FREQUENCY_RANGE_GROUP_UNKNOWN = 0; // 0x0
  }

  public final class BarringInfo implements android.os.Parcelable {
    ctor public BarringInfo();
    method @NonNull public android.telephony.BarringInfo createLocationInfoSanitizedCopy();
  }

  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 @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallAttributes> CREATOR;
  }

  public final class CallForwardingInfo implements android.os.Parcelable {
    ctor public CallForwardingInfo(int, int, @Nullable String, int);
    method public int describeContents();
    method @Nullable public String getNumber();
    method public int getReason();
    method public int getStatus();
    method public int getTimeoutSeconds();
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallForwardingInfo> CREATOR;
    field public static final int REASON_ALL = 4; // 0x4
    field public static final int REASON_ALL_CONDITIONAL = 5; // 0x5
    field public static final int REASON_BUSY = 1; // 0x1
    field public static final int REASON_NOT_REACHABLE = 3; // 0x3
    field public static final int REASON_NO_REPLY = 2; // 0x2
    field public static final int REASON_UNCONDITIONAL = 0; // 0x0
    field public static final int STATUS_ACTIVE = 1; // 0x1
    field public static final int STATUS_FDN_CHECK_FAILURE = 2; // 0x2
    field public static final int STATUS_INACTIVE = 0; // 0x0
    field public static final int STATUS_NOT_SUPPORTED = 4; // 0x4
    field public static final int STATUS_UNKNOWN_ERROR = 3; // 0x3
  }

  public final class CallQuality implements android.os.Parcelable {
    ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int);
    ctor public CallQuality(int, int, int, int, int, int, int, int, int, int, int, boolean, boolean, boolean);
    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 boolean isIncomingSilenceDetected();
    method public boolean isOutgoingSilenceDetected();
    method public boolean isRtpInactivityDetected();
    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 @NonNull public static final android.os.Parcelable.Creator<android.telephony.CallQuality> CREATOR;
  }

  public class CarrierConfigManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDefaultCarrierServicePackageName();
    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";
    field public static final String KEY_SUPPORT_CDMA_1X_VOICE_CALLS_BOOL = "support_cdma_1x_voice_calls_bool";
  }

  public static final class CarrierConfigManager.Wifi {
    field public static final String KEY_HOTSPOT_MAX_CLIENT_COUNT = "wifi.hotspot_maximum_client_count";
    field public static final String KEY_PREFIX = "wifi.";
  }

  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 @NonNull 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 {
    ctor public 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 class CbGeoUtils {
  }

  public static class CbGeoUtils.Circle implements android.telephony.CbGeoUtils.Geometry {
    ctor public CbGeoUtils.Circle(@NonNull android.telephony.CbGeoUtils.LatLng, double);
    method public boolean contains(@NonNull android.telephony.CbGeoUtils.LatLng);
    method @NonNull public android.telephony.CbGeoUtils.LatLng getCenter();
    method public double getRadius();
  }

  public static interface CbGeoUtils.Geometry {
    method public boolean contains(@NonNull android.telephony.CbGeoUtils.LatLng);
  }

  public static class CbGeoUtils.LatLng {
    ctor public CbGeoUtils.LatLng(double, double);
    method public double distance(@NonNull android.telephony.CbGeoUtils.LatLng);
    method @NonNull public android.telephony.CbGeoUtils.LatLng subtract(@NonNull android.telephony.CbGeoUtils.LatLng);
    field public final double lat;
    field public final double lng;
  }

  public static class CbGeoUtils.Polygon implements android.telephony.CbGeoUtils.Geometry {
    ctor public CbGeoUtils.Polygon(@NonNull java.util.List<android.telephony.CbGeoUtils.LatLng>);
    method public boolean contains(@NonNull android.telephony.CbGeoUtils.LatLng);
    method @NonNull public java.util.List<android.telephony.CbGeoUtils.LatLng> getVertices();
  }

  public final class CdmaEriInformation implements android.os.Parcelable {
    method public int describeContents();
    method public int getEriIconIndex();
    method public int getEriIconMode();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CdmaEriInformation> CREATOR;
    field public static final int ERI_FLASH = 2; // 0x2
    field public static final int ERI_ICON_MODE_FLASH = 1; // 0x1
    field public static final int ERI_ICON_MODE_NORMAL = 0; // 0x0
    field public static final int ERI_OFF = 1; // 0x1
    field public static final int ERI_ON = 0; // 0x0
  }

  public class CellBroadcastIntents {
    method public static void sendSmsCbReceivedBroadcast(@NonNull android.content.Context, @Nullable android.os.UserHandle, @NonNull android.telephony.SmsCbMessage, @Nullable android.content.BroadcastReceiver, @Nullable android.os.Handler, int, int);
    field public static final String ACTION_AREA_INFO_UPDATED = "android.telephony.action.AREA_INFO_UPDATED";
  }

  public abstract class CellBroadcastService extends android.app.Service {
    ctor public CellBroadcastService();
    method @NonNull @WorkerThread public abstract CharSequence getCellBroadcastAreaInfo(int);
    method @CallSuper public android.os.IBinder onBind(@Nullable android.content.Intent);
    method public abstract void onCdmaCellBroadcastSms(int, @NonNull byte[], int);
    method public abstract void onCdmaScpMessage(int, @NonNull java.util.List<android.telephony.cdma.CdmaSmsCbProgramData>, @NonNull String, @NonNull java.util.function.Consumer<android.os.Bundle>);
    method public abstract void onGsmCellBroadcastSms(int, @NonNull byte[]);
    field public static final String CELL_BROADCAST_SERVICE_INTERFACE = "android.telephony.CellBroadcastService";
  }

  public abstract class CellIdentity implements android.os.Parcelable {
    method @NonNull public abstract android.telephony.CellLocation asCellLocation();
    method @NonNull public abstract android.telephony.CellIdentity sanitizeLocationInfo();
  }

  public final class CellIdentityCdma extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.cdma.CdmaCellLocation asCellLocation();
    method @NonNull public android.telephony.CellIdentityCdma sanitizeLocationInfo();
  }

  public final class CellIdentityGsm extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
    method @NonNull public android.telephony.CellIdentityGsm sanitizeLocationInfo();
  }

  public final class CellIdentityLte extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
    method @NonNull public android.telephony.CellIdentityLte sanitizeLocationInfo();
  }

  public final class CellIdentityNr extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.CellLocation asCellLocation();
    method @NonNull public android.telephony.CellIdentityNr sanitizeLocationInfo();
  }

  public final class CellIdentityTdscdma extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
    method @NonNull public android.telephony.CellIdentityTdscdma sanitizeLocationInfo();
  }

  public final class CellIdentityWcdma extends android.telephony.CellIdentity {
    method @NonNull public android.telephony.gsm.GsmCellLocation asCellLocation();
    method @NonNull public android.telephony.CellIdentityWcdma sanitizeLocationInfo();
  }

  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_NETWORK_PARAMETER = 65538; // 0x10002
    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 DataSpecificRegistrationInfo implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.telephony.LteVopsSupportInfo getLteVopsSupportInfo();
    method public boolean isUsingCarrierAggregation();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.DataSpecificRegistrationInfo> 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_AUTO_REJECTED = 81; // 0x51
    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_EMERGENCY_CALL_PLACED = 80; // 0x50
    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 ImsiEncryptionInfo implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getKeyIdentifier();
    method @Nullable public java.security.PublicKey getPublicKey();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ImsiEncryptionInfo> CREATOR;
  }

  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 @NonNull 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 final class ModemActivityInfo implements android.os.Parcelable {
    ctor public ModemActivityInfo(long, int, int, @NonNull int[], int);
    method public int describeContents();
    method public int getIdleTimeMillis();
    method public int getReceiveTimeMillis();
    method public int getSleepTimeMillis();
    method public long getTimestamp();
    method @NonNull public java.util.List<android.telephony.ModemActivityInfo.TransmitPower> getTransmitPowerInfo();
    method public boolean isValid();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ModemActivityInfo> CREATOR;
    field public static final int TX_POWER_LEVELS = 5; // 0x5
  }

  public class ModemActivityInfo.TransmitPower {
    method @NonNull public android.util.Range<java.lang.Integer> getPowerRangeInDbm();
    method public int getTimeInMillis();
  }

  public final class NetworkRegistrationInfo implements android.os.Parcelable {
    method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo();
    method public int getRegistrationState();
    method public int getRejectCause();
    method public int getRoamingType();
    method public boolean isEmergencyEnabled();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int REGISTRATION_STATE_DENIED = 3; // 0x3
    field public static final int REGISTRATION_STATE_HOME = 1; // 0x1
    field public static final int REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING = 0; // 0x0
    field public static final int REGISTRATION_STATE_NOT_REGISTERED_SEARCHING = 2; // 0x2
    field public static final int REGISTRATION_STATE_ROAMING = 5; // 0x5
    field public static final int REGISTRATION_STATE_UNKNOWN = 4; // 0x4
  }

  public static final class NetworkRegistrationInfo.Builder {
    ctor public NetworkRegistrationInfo.Builder();
    method @NonNull public android.telephony.NetworkRegistrationInfo build();
    method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setAccessNetworkTechnology(int);
    method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setAvailableServices(@NonNull java.util.List<java.lang.Integer>);
    method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setCellIdentity(@Nullable android.telephony.CellIdentity);
    method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setDomain(int);
    method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setEmergencyOnly(boolean);
    method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRegisteredPlmn(@Nullable String);
    method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRegistrationState(int);
    method @NonNull public android.telephony.NetworkRegistrationInfo.Builder setRejectCause(int);
    method @NonNull public android.telephony.NetworkRegistrationInfo.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 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 final int getSlotIndex();
    method public final void notifyNetworkRegistrationInfoChanged();
    method public void requestNetworkRegistrationInfo(int, @NonNull android.telephony.NetworkServiceCallback);
  }

  public class NetworkServiceCallback {
    method public void onRequestNetworkRegistrationInfoComplete(int, @Nullable android.telephony.NetworkRegistrationInfo);
    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 @NonNull public static final android.os.Parcelable.Creator<android.telephony.PhoneNumberRange> CREATOR;
  }

  public class PhoneNumberUtils {
    method @NonNull public static String getUsernameFromUriNumber(@NonNull String);
    method public static boolean isUriNumber(@Nullable String);
    method public static boolean isVoiceMailNumber(@NonNull android.content.Context, int, @Nullable String);
  }

  public class PhoneStateListener {
    method public void onCallAttributesChanged(@NonNull android.telephony.CallAttributes);
    method public void onOutgoingEmergencyCall(@NonNull android.telephony.emergency.EmergencyNumber);
    method public void onOutgoingEmergencySms(@NonNull android.telephony.emergency.EmergencyNumber);
    method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onPreciseCallStateChanged(@NonNull android.telephony.PreciseCallState);
    method public void onRadioPowerStateChanged(int);
    method public void onSrvccStateChanged(int);
    method public void onVoiceActivationStateChanged(int);
    field @RequiresPermission(android.Manifest.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH) public static final int LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH = 512; // 0x200
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_CALL_ATTRIBUTES_CHANGED = 67108864; // 0x4000000
    field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int LISTEN_OUTGOING_EMERGENCY_CALL = 268435456; // 0x10000000
    field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int LISTEN_OUTGOING_EMERGENCY_SMS = 536870912; // 0x20000000
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_PRECISE_CALL_STATE = 2048; // 0x800
    field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) 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 @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_VOICE_ACTIVATION_STATE = 131072; // 0x20000
  }

  public final class PinResult implements android.os.Parcelable {
    ctor public PinResult(int, int);
    method public int describeContents();
    method public int getAttemptsRemaining();
    method @NonNull public static android.telephony.PinResult getDefaultFailedResult();
    method public int getType();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PinResult> CREATOR;
    field public static final int PIN_RESULT_TYPE_FAILURE = 2; // 0x2
    field public static final int PIN_RESULT_TYPE_INCORRECT = 1; // 0x1
    field public static final int PIN_RESULT_TYPE_SUCCESS = 0; // 0x0
  }

  public final class PreciseCallState implements android.os.Parcelable {
    ctor public PreciseCallState(int, int, int, int, int);
    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 @NonNull 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 {
    ctor public PreciseDataConnectionState(int, int, int, @NonNull String, @Nullable android.net.LinkProperties, int, @Nullable android.telephony.data.ApnSetting);
    method @Deprecated @NonNull public String getDataConnectionApn();
    method @Deprecated public int getDataConnectionApnTypeBitMask();
    method @Deprecated public int getDataConnectionFailCause();
    method @Deprecated @Nullable public android.net.LinkProperties getDataConnectionLinkProperties();
    method @Deprecated public int getDataConnectionNetworkType();
    method @Deprecated public int getDataConnectionState();
  }

  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 @NonNull public android.telephony.ServiceState createLocationInfoSanitizedCopy(boolean);
    method public void fillInNotifierBundle(@NonNull android.os.Bundle);
    method public int getDataNetworkType();
    method public int getDataRegistrationState();
    method public boolean getDataRoamingFromRegistration();
    method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int);
    method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForDomain(int);
    method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoListForTransportType(int);
    method public int getNrFrequencyRange();
    method @Nullable public String getOperatorAlphaLongRaw();
    method @Nullable public String getOperatorAlphaShortRaw();
    method @NonNull public static android.telephony.ServiceState newFromBundle(@NonNull android.os.Bundle);
    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 class SignalStrength implements android.os.Parcelable {
    ctor public SignalStrength(@NonNull android.telephony.SignalStrength);
  }

  public final class SmsCbCmasInfo implements android.os.Parcelable {
    ctor public SmsCbCmasInfo(int, int, int, int, int, int);
    method public int describeContents();
    method public int getCategory();
    method public int getCertainty();
    method public int getMessageClass();
    method public int getResponseType();
    method public int getSeverity();
    method public int getUrgency();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CMAS_CATEGORY_CBRNE = 10; // 0xa
    field public static final int CMAS_CATEGORY_ENV = 7; // 0x7
    field public static final int CMAS_CATEGORY_FIRE = 5; // 0x5
    field public static final int CMAS_CATEGORY_GEO = 0; // 0x0
    field public static final int CMAS_CATEGORY_HEALTH = 6; // 0x6
    field public static final int CMAS_CATEGORY_INFRA = 9; // 0x9
    field public static final int CMAS_CATEGORY_MET = 1; // 0x1
    field public static final int CMAS_CATEGORY_OTHER = 11; // 0xb
    field public static final int CMAS_CATEGORY_RESCUE = 4; // 0x4
    field public static final int CMAS_CATEGORY_SAFETY = 2; // 0x2
    field public static final int CMAS_CATEGORY_SECURITY = 3; // 0x3
    field public static final int CMAS_CATEGORY_TRANSPORT = 8; // 0x8
    field public static final int CMAS_CATEGORY_UNKNOWN = -1; // 0xffffffff
    field public static final int CMAS_CERTAINTY_LIKELY = 1; // 0x1
    field public static final int CMAS_CERTAINTY_OBSERVED = 0; // 0x0
    field public static final int CMAS_CERTAINTY_UNKNOWN = -1; // 0xffffffff
    field public static final int CMAS_CLASS_CHILD_ABDUCTION_EMERGENCY = 3; // 0x3
    field public static final int CMAS_CLASS_CMAS_EXERCISE = 5; // 0x5
    field public static final int CMAS_CLASS_EXTREME_THREAT = 1; // 0x1
    field public static final int CMAS_CLASS_OPERATOR_DEFINED_USE = 6; // 0x6
    field public static final int CMAS_CLASS_PRESIDENTIAL_LEVEL_ALERT = 0; // 0x0
    field public static final int CMAS_CLASS_REQUIRED_MONTHLY_TEST = 4; // 0x4
    field public static final int CMAS_CLASS_SEVERE_THREAT = 2; // 0x2
    field public static final int CMAS_CLASS_UNKNOWN = -1; // 0xffffffff
    field public static final int CMAS_RESPONSE_TYPE_ASSESS = 6; // 0x6
    field public static final int CMAS_RESPONSE_TYPE_AVOID = 5; // 0x5
    field public static final int CMAS_RESPONSE_TYPE_EVACUATE = 1; // 0x1
    field public static final int CMAS_RESPONSE_TYPE_EXECUTE = 3; // 0x3
    field public static final int CMAS_RESPONSE_TYPE_MONITOR = 4; // 0x4
    field public static final int CMAS_RESPONSE_TYPE_NONE = 7; // 0x7
    field public static final int CMAS_RESPONSE_TYPE_PREPARE = 2; // 0x2
    field public static final int CMAS_RESPONSE_TYPE_SHELTER = 0; // 0x0
    field public static final int CMAS_RESPONSE_TYPE_UNKNOWN = -1; // 0xffffffff
    field public static final int CMAS_SEVERITY_EXTREME = 0; // 0x0
    field public static final int CMAS_SEVERITY_SEVERE = 1; // 0x1
    field public static final int CMAS_SEVERITY_UNKNOWN = -1; // 0xffffffff
    field public static final int CMAS_URGENCY_EXPECTED = 1; // 0x1
    field public static final int CMAS_URGENCY_IMMEDIATE = 0; // 0x0
    field public static final int CMAS_URGENCY_UNKNOWN = -1; // 0xffffffff
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbCmasInfo> CREATOR;
  }

  public final class SmsCbEtwsInfo implements android.os.Parcelable {
    ctor public SmsCbEtwsInfo(int, boolean, boolean, boolean, @Nullable byte[]);
    method public int describeContents();
    method @Nullable public byte[] getPrimaryNotificationSignature();
    method public long getPrimaryNotificationTimestamp();
    method public int getWarningType();
    method public boolean isEmergencyUserAlert();
    method public boolean isPopupAlert();
    method public boolean isPrimary();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbEtwsInfo> CREATOR;
    field public static final int ETWS_WARNING_TYPE_EARTHQUAKE = 0; // 0x0
    field public static final int ETWS_WARNING_TYPE_EARTHQUAKE_AND_TSUNAMI = 2; // 0x2
    field public static final int ETWS_WARNING_TYPE_OTHER_EMERGENCY = 4; // 0x4
    field public static final int ETWS_WARNING_TYPE_TEST_MESSAGE = 3; // 0x3
    field public static final int ETWS_WARNING_TYPE_TSUNAMI = 1; // 0x1
    field public static final int ETWS_WARNING_TYPE_UNKNOWN = -1; // 0xffffffff
  }

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

  public final class SmsCbMessage implements android.os.Parcelable {
    ctor public SmsCbMessage(int, int, int, @NonNull android.telephony.SmsCbLocation, int, @Nullable String, int, @Nullable String, int, @Nullable android.telephony.SmsCbEtwsInfo, @Nullable android.telephony.SmsCbCmasInfo, int, @Nullable java.util.List<android.telephony.CbGeoUtils.Geometry>, long, int, int);
    method @NonNull public static android.telephony.SmsCbMessage createFromCursor(@NonNull android.database.Cursor);
    method public int describeContents();
    method @Nullable public android.telephony.SmsCbCmasInfo getCmasWarningInfo();
    method @NonNull public android.content.ContentValues getContentValues();
    method public int getDataCodingScheme();
    method @Nullable public android.telephony.SmsCbEtwsInfo getEtwsWarningInfo();
    method public int getGeographicalScope();
    method @NonNull public java.util.List<android.telephony.CbGeoUtils.Geometry> getGeometries();
    method @Nullable public String getLanguageCode();
    method @NonNull public android.telephony.SmsCbLocation getLocation();
    method public int getMaximumWaitingDuration();
    method @Nullable public String getMessageBody();
    method public int getMessageFormat();
    method public int getMessagePriority();
    method public long getReceivedTime();
    method public int getSerialNumber();
    method public int getServiceCategory();
    method public int getSlotIndex();
    method public int getSubscriptionId();
    method public boolean isCmasMessage();
    method public boolean isEmergencyMessage();
    method public boolean isEtwsMessage();
    method public boolean needGeoFencingCheck();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SmsCbMessage> CREATOR;
    field public static final int GEOGRAPHICAL_SCOPE_CELL_WIDE = 3; // 0x3
    field public static final int GEOGRAPHICAL_SCOPE_CELL_WIDE_IMMEDIATE = 0; // 0x0
    field public static final int GEOGRAPHICAL_SCOPE_LOCATION_AREA_WIDE = 2; // 0x2
    field public static final int GEOGRAPHICAL_SCOPE_PLMN_WIDE = 1; // 0x1
    field public static final int MAXIMUM_WAIT_TIME_NOT_SET = 255; // 0xff
    field public static final int MESSAGE_FORMAT_3GPP = 1; // 0x1
    field public static final int MESSAGE_FORMAT_3GPP2 = 2; // 0x2
    field public static final int MESSAGE_PRIORITY_EMERGENCY = 3; // 0x3
    field public static final int MESSAGE_PRIORITY_INTERACTIVE = 1; // 0x1
    field public static final int MESSAGE_PRIORITY_NORMAL = 0; // 0x0
    field public static final int MESSAGE_PRIORITY_URGENT = 2; // 0x2
  }

  public final class SmsManager {
    method @RequiresPermission(android.Manifest.permission.ACCESS_MESSAGES_ON_ICC) public boolean copyMessageToIcc(@Nullable byte[], @NonNull byte[], int);
    method @RequiresPermission(android.Manifest.permission.ACCESS_MESSAGES_ON_ICC) public boolean deleteMessageFromIcc(int);
    method public boolean disableCellBroadcastRange(int, int, int);
    method public boolean enableCellBroadcastRange(int, int, int);
    method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_MESSAGES_ON_ICC) public java.util.List<android.telephony.SmsMessage> getMessagesFromIcc();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getPremiumSmsConsent(@NonNull String);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSmsCapacityOnIcc();
    method public void sendMultipartTextMessage(@NonNull String, @Nullable String, @NonNull java.util.List<java.lang.String>, @Nullable java.util.List<android.app.PendingIntent>, @Nullable java.util.List<android.app.PendingIntent>, @NonNull String);
    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>);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPremiumSmsConsent(@NonNull String, int);
    field public static final int PREMIUM_SMS_CONSENT_ALWAYS_ALLOW = 3; // 0x3
    field public static final int PREMIUM_SMS_CONSENT_ASK_USER = 1; // 0x1
    field public static final int PREMIUM_SMS_CONSENT_NEVER_ALLOW = 2; // 0x2
    field public static final int PREMIUM_SMS_CONSENT_UNKNOWN = 0; // 0x0
  }

  public class SmsMessage {
    method @Nullable public static android.telephony.SmsMessage createFromNativeSmsSubmitPdu(@NonNull byte[], boolean);
    method @Nullable public static android.telephony.SmsMessage.SubmitPdu getSmsPdu(int, int, @Nullable String, @NonNull String, @NonNull String, long);
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static byte[] getSubmitPduEncodedMessage(boolean, @NonNull String, @NonNull String, int, int, int, int, int, int);
  }

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

  public class SubscriptionManager {
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean canDisablePhysicalSubscription();
    method public boolean canManageSubscription(@Nullable android.telephony.SubscriptionInfo, @Nullable String);
    method @NonNull public int[] getActiveAndHiddenSubscriptionIdList();
    method @NonNull public int[] getActiveSubscriptionIdList();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfoForIcc(@NonNull String);
    method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int);
    method @NonNull public static android.content.res.Resources getResourcesForSubId(@NonNull android.content.Context, 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 void setDefaultVoiceSubscriptionId(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setDisplayName(@Nullable String, int, int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setIconTint(@ColorInt int, int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPreferredDataSubscriptionId(int, boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Integer>);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUiccApplicationsEnabled(boolean, int);
    field @RequiresPermission(android.Manifest.permission.MANAGE_SUBSCRIPTION_PLANS) public static final String ACTION_SUBSCRIPTION_PLANS_CHANGED = "android.telephony.action.SUBSCRIPTION_PLANS_CHANGED";
    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 class TelephonyFrameworkInitializer {
    method public static void registerServiceWrappers();
    method public static void setTelephonyServiceManager(@NonNull android.os.TelephonyServiceManager);
  }

  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 @NonNull 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 public int addDevicePolicyOverrideApn(@NonNull android.content.Context, @NonNull android.telephony.data.ApnSetting);
    method @Deprecated @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void call(String, String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int changeIccLockPassword(@NonNull String, @NonNull 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 @Deprecated @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 @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getAllowedNetworkTypes();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.CallForwardingInfo getCallForwarding(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCallWaitingStatus();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.ImsiEncryptionInfo getCarrierInfoForImsiEncryption(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 @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCarrierPrivilegeStatus(int);
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List<java.lang.String> getCarrierPrivilegedPackagesForAllActiveSubscriptions();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.CarrierRestrictionRules getCarrierRestrictionRules();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.CdmaEriInformation getCdmaEriInformation();
    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 @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCdmaRoamingMode();
    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 @Nullable public static android.content.ComponentName getDefaultRespondViaMessageApplication(@NonNull android.content.Context, boolean);
    method @NonNull public static String getDefaultSimCountryIso();
    method @NonNull public java.util.List<android.telephony.data.ApnSetting> getDevicePolicyOverrideApns(@NonNull android.content.Context);
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getDeviceSoftwareVersion(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode();
    method public int getEmergencyNumberDbVersion();
    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[] getIsimImpu();
    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.Map<java.lang.Integer,java.lang.Integer> getLogicalToPhysicalSlotMapping();
    method public int getMaxNumberOfSimultaneouslyActiveSims();
    method public static long getMaxNumberVerificationTimeoutMillis();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String[] getMergedImsisFromGroup();
    method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getNetworkCountryIso(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public long getPreferredNetworkTypeBitmask();
    method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public int getRadioPowerState();
    method public int getSimApplicationState();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSimApplicationState(int);
    method public int getSimCardState();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getSimCardState(int);
    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 @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean iccCloseLogicalChannelBySlot(int, int);
    method @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannelBySlot(int, @Nullable String, int);
    method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String iccTransmitApduBasicChannelBySlot(int, int, int, int, int, int, @Nullable String);
    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String iccTransmitApduLogicalChannelBySlot(int, int, int, int, int, int, int, @Nullable String);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAnyRadioPoweredOn();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isApnMetered(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isApplicationOnUicc(int);
    method public boolean isCurrentSimOperator(@NonNull String, int, @Nullable String);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataAllowedInVoiceCall();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataConnectionEnabled();
    method public boolean isDataConnectivityPossible();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataEnabledForApn(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isEmergencyAssistanceEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isGlobalModeEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public boolean isIccLockEnabled();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isIdle();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isInEmergencySmsMode();
    method public boolean isModemEnabledForSlot(int);
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isOpportunisticNetworkEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String);
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean isTetheringApnRequired();
    method @Deprecated @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 modifyDevicePolicyOverrideApn(@NonNull android.content.Context, int, @NonNull android.telephony.data.ApnSetting);
    method public boolean needsOtaServiceProvisioning();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyOtaEmergencyNumberDbInstalled();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyUserActivity();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean rebootRadio();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void reportDefaultNetworkStatus(boolean);
    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 public void requestModemActivityInfo(@NonNull android.os.ResultReceiver);
    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 void resetAllCarrierActions();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void resetCarrierKeysForImsiEncryption();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void resetIms(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean resetRadioConfig();
    method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings();
    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 boolean setAllowedNetworkTypes(long);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAlwaysAllowMmsData(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setAlwaysReportSignalStrength(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setCallForwarding(@NonNull android.telephony.CallForwardingInfo);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setCallWaitingStatus(boolean);
    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 boolean setCdmaRoamingMode(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setCdmaSubscriptionMode(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setDataAllowedDuringVoiceCall(boolean);
    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 int setIccLockEnabled(boolean, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setNetworkSelectionModeManual(@NonNull String, int, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setOpportunisticNetworkState(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPolicyDataEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setPreferredNetworkTypeBitmask(long);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadio(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setRadioEnabled(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 @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSystemSelectionChannels(@NonNull java.util.List<android.telephony.RadioAccessSpecifier>, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer<java.lang.Boolean>);
    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 void shutdownAllRadios();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPin(String);
    method @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyPinReportPinResult(@NonNull String);
    method @Deprecated @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 @Nullable @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyPukReportPinResult(@NonNull String, @NonNull String);
    method @Deprecated @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();
    method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateTestOtaEmergencyNumberDbFilePath(@NonNull String);
    field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final String ACTION_ANOMALY_REPORTED = "android.telephony.action.ANOMALY_REPORTED";
    field public static final String ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE = "com.android.internal.telephony.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE";
    field public static final String ACTION_CARRIER_SIGNAL_PCO_VALUE = "com.android.internal.telephony.CARRIER_SIGNAL_PCO_VALUE";
    field public static final String ACTION_CARRIER_SIGNAL_REDIRECTED = "com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED";
    field public static final String ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED = "com.android.internal.telephony.CARRIER_SIGNAL_REQUEST_NETWORK_FAILED";
    field public static final String ACTION_CARRIER_SIGNAL_RESET = "com.android.internal.telephony.CARRIER_SIGNAL_RESET";
    field public static final String ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED";
    field public static final String ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED";
    field public static final String ACTION_EMERGENCY_ASSISTANCE = "android.telephony.action.EMERGENCY_ASSISTANCE";
    field public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
    field public static final String ACTION_EMERGENCY_CALL_STATE_CHANGED = "android.intent.action.EMERGENCY_CALL_STATE_CHANGED";
    field public static final String ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE = "com.android.omadm.service.CONFIGURATION_UPDATE";
    field public static final String ACTION_SERVICE_PROVIDERS_UPDATED = "android.telephony.action.SERVICE_PROVIDERS_UPDATED";
    field public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS = "android.telephony.action.SHOW_NOTICE_ECM_BLOCK_OTHERS";
    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 CALL_WAITING_STATUS_ACTIVE = 1; // 0x1
    field public static final int CALL_WAITING_STATUS_INACTIVE = 2; // 0x2
    field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
    field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
    field public static final int CARD_POWER_DOWN = 0; // 0x0
    field public static final int CARD_POWER_UP = 1; // 0x1
    field public static final int CARD_POWER_UP_PASS_THROUGH = 2; // 0x2
    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 int CDMA_SUBSCRIPTION_NV = 1; // 0x1
    field public static final int CDMA_SUBSCRIPTION_RUIM_SIM = 0; // 0x0
    field public static final int CDMA_SUBSCRIPTION_UNKNOWN = -1; // 0xffffffff
    field public static final int CHANGE_ICC_LOCK_SUCCESS = 2147483647; // 0x7fffffff
    field public static final String EXTRA_ANOMALY_DESCRIPTION = "android.telephony.extra.ANOMALY_DESCRIPTION";
    field public static final String EXTRA_ANOMALY_ID = "android.telephony.extra.ANOMALY_ID";
    field @Deprecated public static final String EXTRA_APN_PROTOCOL = "apnProto";
    field public static final String EXTRA_APN_PROTOCOL_INT = "apnProtoInt";
    field @Deprecated public static final String EXTRA_APN_TYPE = "apnType";
    field public static final String EXTRA_APN_TYPE_INT = "apnTypeInt";
    field public static final String EXTRA_DATA_SPN = "android.telephony.extra.DATA_SPN";
    field public static final String EXTRA_DEFAULT_NETWORK_AVAILABLE = "defaultNetworkAvailable";
    field public static final String EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE = "android.telephony.extra.DEFAULT_SUBSCRIPTION_SELECT_TYPE";
    field public static final int EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_ALL = 4; // 0x4
    field public static final int EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_DATA = 1; // 0x1
    field public static final int EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_NONE = 0; // 0x0
    field public static final int EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_SMS = 3; // 0x3
    field public static final int EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_VOICE = 2; // 0x2
    field public static final String EXTRA_ERROR_CODE = "errorCode";
    field public static final String EXTRA_PCO_ID = "pcoId";
    field public static final String EXTRA_PCO_VALUE = "pcoValue";
    field public static final String EXTRA_PHONE_IN_ECM_STATE = "android.telephony.extra.PHONE_IN_ECM_STATE";
    field public static final String EXTRA_PHONE_IN_EMERGENCY_CALL = "android.telephony.extra.PHONE_IN_EMERGENCY_CALL";
    field public static final String EXTRA_PLMN = "android.telephony.extra.PLMN";
    field public static final String EXTRA_REDIRECTION_URL = "redirectionUrl";
    field public static final String EXTRA_SHOW_PLMN = "android.telephony.extra.SHOW_PLMN";
    field public static final String EXTRA_SHOW_SPN = "android.telephony.extra.SHOW_SPN";
    field public static final String EXTRA_SIM_COMBINATION_NAMES = "android.telephony.extra.SIM_COMBINATION_NAMES";
    field public static final String EXTRA_SIM_COMBINATION_WARNING_TYPE = "android.telephony.extra.SIM_COMBINATION_WARNING_TYPE";
    field public static final int EXTRA_SIM_COMBINATION_WARNING_TYPE_DUAL_CDMA = 1; // 0x1
    field public static final int EXTRA_SIM_COMBINATION_WARNING_TYPE_NONE = 0; // 0x0
    field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
    field public static final String EXTRA_SPN = "android.telephony.extra.SPN";
    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 int INVALID_EMERGENCY_NUMBER_DB_VERSION = -1; // 0xffffffff
    field public static final int KEY_TYPE_EPDG = 1; // 0x1
    field public static final int KEY_TYPE_WLAN = 2; // 0x2
    field public static final String MODEM_ACTIVITY_RESULT_KEY = "controller_activity";
    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 PHONE_TYPE_THIRD_PARTY = 4; // 0x4
    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 class TelephonyRegistryManager {
    method public void addOnOpportunisticSubscriptionsChangedListener(@NonNull android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener, @NonNull java.util.concurrent.Executor);
    method public void addOnSubscriptionsChangedListener(@NonNull android.telephony.SubscriptionManager.OnSubscriptionsChangedListener, @NonNull java.util.concurrent.Executor);
    method public void listenForSubscriber(int, @NonNull String, @NonNull String, @NonNull android.telephony.PhoneStateListener, int, boolean);
    method public void notifyActiveDataSubIdChanged(int);
    method public void notifyBarringInfoChanged(int, int, @NonNull android.telephony.BarringInfo);
    method public void notifyCallForwardingChanged(int, boolean);
    method public void notifyCallQualityChanged(int, int, @NonNull android.telephony.CallQuality, int);
    method public void notifyCallStateChanged(int, int, int, @Nullable String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyCallStateChangedForAllSubscriptions(int, @Nullable String);
    method public void notifyCarrierNetworkChange(boolean);
    method public void notifyCellInfoChanged(int, @NonNull java.util.List<android.telephony.CellInfo>);
    method public void notifyCellLocation(int, @NonNull android.telephony.CellIdentity);
    method public void notifyDataActivationStateChanged(int, int, int);
    method public void notifyDataActivityChanged(int, int);
    method public void notifyDataConnectionForSubscriber(int, int, int, @Nullable android.telephony.PreciseDataConnectionState);
    method public void notifyDisconnectCause(int, int, int, int);
    method public void notifyDisplayInfoChanged(int, int, @NonNull android.telephony.DisplayInfo);
    method public void notifyEmergencyNumberList(int, int);
    method public void notifyImsDisconnectCause(int, @NonNull android.telephony.ims.ImsReasonInfo);
    method public void notifyMessageWaitingChanged(int, int, boolean);
    method public void notifyOpportunisticSubscriptionInfoChanged();
    method public void notifyOutgoingEmergencyCall(int, int, @NonNull android.telephony.emergency.EmergencyNumber);
    method public void notifyOutgoingEmergencySms(int, int, @NonNull android.telephony.emergency.EmergencyNumber);
    method public void notifyPhoneCapabilityChanged(@NonNull android.telephony.PhoneCapability);
    method public void notifyPreciseCallState(int, int, int, int, int);
    method public void notifyPreciseDataConnectionFailed(int, int, int, @Nullable String, int);
    method public void notifyRadioPowerStateChanged(int, int, int);
    method public void notifyRegistrationFailed(int, int, @NonNull android.telephony.CellIdentity, @NonNull String, int, int, int);
    method public void notifyServiceStateChanged(int, int, @NonNull android.telephony.ServiceState);
    method public void notifySignalStrengthChanged(int, int, @NonNull android.telephony.SignalStrength);
    method public void notifySrvccStateChanged(int, int);
    method public void notifySubscriptionInfoChanged();
    method public void notifyUserMobileDataStateChanged(int, int, boolean);
    method public void notifyVoiceActivationStateChanged(int, int, int);
    method public void removeOnOpportunisticSubscriptionsChangedListener(@NonNull android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener);
    method public void removeOnSubscriptionsChangedListener(@NonNull android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
  }

  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 @NonNull 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 @NonNull 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.cdma {

  public final class CdmaSmsCbProgramData implements android.os.Parcelable {
    method public int describeContents();
    method public int getCategory();
    method public int getOperation();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CATEGORY_CMAS_CHILD_ABDUCTION_EMERGENCY = 4099; // 0x1003
    field public static final int CATEGORY_CMAS_EXTREME_THREAT = 4097; // 0x1001
    field public static final int CATEGORY_CMAS_LAST_RESERVED_VALUE = 4351; // 0x10ff
    field public static final int CATEGORY_CMAS_PRESIDENTIAL_LEVEL_ALERT = 4096; // 0x1000
    field public static final int CATEGORY_CMAS_SEVERE_THREAT = 4098; // 0x1002
    field public static final int CATEGORY_CMAS_TEST_MESSAGE = 4100; // 0x1004
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.cdma.CdmaSmsCbProgramData> CREATOR;
    field public static final int OPERATION_ADD_CATEGORY = 1; // 0x1
    field public static final int OPERATION_CLEAR_CATEGORIES = 2; // 0x2
    field public static final int OPERATION_DELETE_CATEGORY = 0; // 0x0
  }

}

package android.telephony.data {

  public class ApnSetting implements android.os.Parcelable {
    method @NonNull public static String getApnTypesStringFromBitmask(int);
    field public static final String TYPE_ALL_STRING = "*";
    field public static final String TYPE_CBS_STRING = "cbs";
    field public static final String TYPE_DEFAULT_STRING = "default";
    field public static final String TYPE_DUN_STRING = "dun";
    field public static final String TYPE_EMERGENCY_STRING = "emergency";
    field public static final String TYPE_FOTA_STRING = "fota";
    field public static final String TYPE_HIPRI_STRING = "hipri";
    field public static final String TYPE_IA_STRING = "ia";
    field public static final String TYPE_IMS_STRING = "ims";
    field public static final String TYPE_MCX_STRING = "mcx";
    field public static final String TYPE_MMS_STRING = "mms";
    field public static final String TYPE_SUPL_STRING = "supl";
    field public static final String TYPE_XCAP_STRING = "xcap";
  }

  public final class DataCallResponse implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.List<android.net.LinkAddress> getAddresses();
    method public int getCause();
    method @NonNull public java.util.List<java.net.InetAddress> getDnsAddresses();
    method @NonNull public java.util.List<java.net.InetAddress> getGatewayAddresses();
    method public int getId();
    method @NonNull public String getInterfaceName();
    method public int getLinkStatus();
    method @Deprecated public int getMtu();
    method public int getMtuV4();
    method public int getMtuV6();
    method @NonNull public java.util.List<java.net.InetAddress> getPcscfAddresses();
    method public int getProtocolType();
    method public int getSuggestedRetryTime();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataCallResponse> CREATOR;
    field public static final int LINK_STATUS_ACTIVE = 2; // 0x2
    field public static final int LINK_STATUS_DORMANT = 1; // 0x1
    field public static final int LINK_STATUS_INACTIVE = 0; // 0x0
    field public static final int LINK_STATUS_UNKNOWN = -1; // 0xffffffff
  }

  public static final class DataCallResponse.Builder {
    ctor public DataCallResponse.Builder();
    method @NonNull public android.telephony.data.DataCallResponse build();
    method @NonNull public android.telephony.data.DataCallResponse.Builder setAddresses(@NonNull java.util.List<android.net.LinkAddress>);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setCause(int);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setDnsAddresses(@NonNull java.util.List<java.net.InetAddress>);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setGatewayAddresses(@NonNull java.util.List<java.net.InetAddress>);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setId(int);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setInterfaceName(@NonNull String);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setLinkStatus(int);
    method @Deprecated @NonNull public android.telephony.data.DataCallResponse.Builder setMtu(int);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV4(int);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setMtuV6(int);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setPcscfAddresses(@NonNull java.util.List<java.net.InetAddress>);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setSuggestedRetryTime(int);
  }

  public final class DataProfile implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public String getApn();
    method public int getAuthType();
    method public int getBearerBitmask();
    method @Deprecated public int getMtu();
    method public int getMtuV4();
    method public int getMtuV6();
    method @Nullable public String getPassword();
    method public int getProfileId();
    method public int getProtocolType();
    method public int getRoamingProtocolType();
    method public int getSupportedApnTypesBitmask();
    method public int getType();
    method @Nullable public String getUserName();
    method public boolean isEnabled();
    method public boolean isPersistent();
    method public boolean isPreferred();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.data.DataProfile> CREATOR;
    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 static final class DataProfile.Builder {
    ctor public DataProfile.Builder();
    method @NonNull public android.telephony.data.DataProfile build();
    method @NonNull public android.telephony.data.DataProfile.Builder enable(boolean);
    method @NonNull public android.telephony.data.DataProfile.Builder setApn(@NonNull String);
    method @NonNull public android.telephony.data.DataProfile.Builder setAuthType(int);
    method @NonNull public android.telephony.data.DataProfile.Builder setBearerBitmask(int);
    method @Deprecated @NonNull public android.telephony.data.DataProfile.Builder setMtu(int);
    method @NonNull public android.telephony.data.DataProfile.Builder setMtuV4(int);
    method @NonNull public android.telephony.data.DataProfile.Builder setMtuV6(int);
    method @NonNull public android.telephony.data.DataProfile.Builder setPassword(@NonNull String);
    method @NonNull public android.telephony.data.DataProfile.Builder setPersistent(boolean);
    method @NonNull public android.telephony.data.DataProfile.Builder setPreferred(boolean);
    method @NonNull public android.telephony.data.DataProfile.Builder setProfileId(int);
    method @NonNull public android.telephony.data.DataProfile.Builder setProtocolType(int);
    method @NonNull public android.telephony.data.DataProfile.Builder setRoamingProtocolType(int);
    method @NonNull public android.telephony.data.DataProfile.Builder setSupportedApnTypesBitmask(int);
    method @NonNull public android.telephony.data.DataProfile.Builder setType(int);
    method @NonNull public android.telephony.data.DataProfile.Builder setUserName(@NonNull String);
  }

  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 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
    field public static final int REQUEST_REASON_UNKNOWN = 0; // 0x0
    field public static final String SERVICE_INTERFACE = "android.telephony.data.DataService";
  }

  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 final int getSlotIndex();
    method public final void notifyDataCallListChanged(java.util.List<android.telephony.data.DataCallResponse>);
    method public void requestDataCallList(@NonNull android.telephony.data.DataServiceCallback);
    method public void setDataProfile(@NonNull java.util.List<android.telephony.data.DataProfile>, boolean, @NonNull android.telephony.data.DataServiceCallback);
    method public void setInitialAttachApn(@NonNull android.telephony.data.DataProfile, boolean, @NonNull android.telephony.data.DataServiceCallback);
    method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @NonNull 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 onRequestDataCallListComplete(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.NetworkAvailabilityProvider onCreateNetworkAvailabilityProvider(int);
    field public static final String QUALIFIED_NETWORKS_SERVICE_INTERFACE = "android.telephony.data.QualifiedNetworksService";
  }

  public abstract class QualifiedNetworksService.NetworkAvailabilityProvider implements java.lang.AutoCloseable {
    ctor public QualifiedNetworksService.NetworkAvailabilityProvider(int);
    method public abstract void close();
    method public final int getSlotIndex();
    method public final void updateQualifiedNetworkTypes(int, @NonNull java.util.List<java.lang.Integer>);
  }

}

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
  }

  @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}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EuiccCardManager.CancelReason {
  }

  @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}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) 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 @Deprecated @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void eraseSubscriptions(@NonNull android.app.PendingIntent);
    method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void eraseSubscriptions(@android.telephony.euicc.EuiccCardManager.ResetOption int, @NonNull 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();
    method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public java.util.List<java.lang.String> getSupportedCountries();
    method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public java.util.List<java.lang.String> getUnsupportedCountries();
    method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public boolean isSupportedCountry(@NonNull String);
    method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void setSupportedCountries(@NonNull java.util.List<java.lang.String>);
    method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void setUnsupportedCountries(@NonNull java.util.List<java.lang.String>);
    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_ACTIVATION_TYPE_ACCOUNT_REQUIRED = 4; // 0x4
    field public static final int EUICC_ACTIVATION_TYPE_BACKUP = 2; // 0x2
    field public static final int EUICC_ACTIVATION_TYPE_DEFAULT = 1; // 0x1
    field public static final int EUICC_ACTIVATION_TYPE_TRANSFER = 3; // 0x3
    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_ACTIVATION_TYPE = "android.telephony.euicc.extra.ACTIVATION_TYPE";
    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_FORCE_PROVISION = "android.telephony.euicc.extra.FORCE_PROVISION";
    field public static final String EXTRA_FROM_SUBSCRIPTION_ID = "android.telephony.euicc.extra.FROM_SUBSCRIPTION_ID";
    field public static final String EXTRA_PHYSICAL_SLOT_ID = "android.telephony.euicc.extra.PHYSICAL_SLOT_ID";
    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 @NonNull 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
  }

  @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}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) 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 @NonNull 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();
  }

  @IntDef(flag=true, prefix={"POLICY_RULE_FLAG_"}, value={android.telephony.euicc.EuiccRulesAuthTable.POLICY_RULE_FLAG_CONSENT_REQUIRED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) 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 @NonNull 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 getCallerNumberVerificationStatus();
    method public int getEmergencyCallRouting();
    method public int getEmergencyServiceCategories();
    method @NonNull public java.util.List<java.lang.String> getEmergencyUrns();
    method public android.telephony.ims.ImsStreamMediaProfile getMediaProfile();
    method @Nullable public android.os.Bundle getProprietaryCallExtras();
    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 setCallerNumberVerificationStatus(int);
    method public void setEmergencyCallRouting(int);
    method public void setEmergencyCallTesting(boolean);
    method public void setEmergencyServiceCategories(int);
    method public void setEmergencyUrns(@NonNull 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 @NonNull 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_DISCONNECT_CAUSE = "android.telephony.ims.extra.CALL_DISCONNECT_CAUSE";
    field public static final String EXTRA_CALL_NETWORK_TYPE = "android.telephony.ims.extra.CALL_NETWORK_TYPE";
    field @Deprecated 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_FORWARDED_NUMBER = "android.telephony.ims.extra.FORWARDED_NUMBER";
    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
    field public static final int VERIFICATION_STATUS_FAILED = 2; // 0x2
    field public static final int VERIFICATION_STATUS_NOT_VERIFIED = 0; // 0x0
    field public static final int VERIFICATION_STATUS_PASSED = 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 @Deprecated public void callSessionHandover(int, int, android.telephony.ims.ImsReasonInfo);
    method @Deprecated 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 @Deprecated 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);
    method public void onHandover(int, int, @Nullable android.telephony.ims.ImsReasonInfo);
    method public void onHandoverFailed(int, int, @NonNull android.telephony.ims.ImsReasonInfo);
    method public void onMayHandover(int, int);
  }

  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 @NonNull 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 final 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);
  }

  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 @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.ImsExternalCallState> CREATOR;
  }

  public class ImsManager {
    method @NonNull public android.telephony.ims.ImsRcsManager getImsRcsManager(int);
    field public static final String ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION = "com.android.internal.intent.action.ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION";
  }

  public class ImsMmTelManager implements android.telephony.ims.RegistrationManager {
    method @Deprecated @NonNull @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PRECISE_PHONE_STATE}) public static android.telephony.ims.ImsMmTelManager createForSubscriptionId(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getFeatureState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>) throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void getRegistrationState(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoWiFiRoamingModeSetting();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAvailable(int, int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isCapable(int, int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void isSupported(int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>) throws android.telephony.ims.ImsException;
    method @Deprecated @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.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 @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback);
  }

  @Deprecated public static class ImsMmTelManager.RegistrationCallback extends android.telephony.ims.RegistrationManager.RegistrationCallback {
    ctor @Deprecated public ImsMmTelManager.RegistrationCallback();
  }

  public class ImsRcsManager implements android.telephony.ims.RegistrationManager {
    method @NonNull public android.telephony.ims.RcsUceAdapter getUceAdapter();
  }

  public final class ImsReasonInfo implements android.os.Parcelable {
    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 @NonNull 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 @NonNull 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 @NonNull 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 @NonNull 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 onLineIdentificationSupplementaryServiceResponse(int, @NonNull android.telephony.ims.ImsSsInfo);
    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 @Deprecated 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);
    field @Deprecated public static final String BUNDLE_KEY_CLIR = "queryClir";
    field @Deprecated public static final String BUNDLE_KEY_SSINFO = "imsSsInfo";
  }

  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 @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public int getProvisioningIntValue(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public boolean getProvisioningStatusForCapability(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) @WorkerThread public boolean getRcsProvisioningStatusForCapability(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyRcsAutoConfigurationReceived(@NonNull byte[], boolean);
    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 @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void setProvisioningStatusForCapability(int, int, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public int setProvisioningStringValue(int, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void setRcsProvisioningStatusForCapability(int, boolean);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterProvisioningChangedCallback(@NonNull android.telephony.ims.ProvisioningManager.Callback);
    field public static final int KEY_1X_EPDG_TIMER_SEC = 64; // 0x40
    field public static final int KEY_1X_THRESHOLD = 59; // 0x3b
    field public static final int KEY_AMR_BANDWIDTH_EFFICIENT_PAYLOAD_TYPE = 50; // 0x32
    field public static final int KEY_AMR_CODEC_MODE_SET_VALUES = 0; // 0x0
    field public static final int KEY_AMR_DEFAULT_ENCODING_MODE = 53; // 0x35
    field public static final int KEY_AMR_OCTET_ALIGNED_PAYLOAD_TYPE = 49; // 0x31
    field public static final int KEY_AMR_WB_BANDWIDTH_EFFICIENT_PAYLOAD_TYPE = 48; // 0x30
    field public static final int KEY_AMR_WB_CODEC_MODE_SET_VALUES = 1; // 0x1
    field public static final int KEY_AMR_WB_OCTET_ALIGNED_PAYLOAD_TYPE = 47; // 0x2f
    field public static final int KEY_DTMF_NB_PAYLOAD_TYPE = 52; // 0x34
    field public static final int KEY_DTMF_WB_PAYLOAD_TYPE = 51; // 0x33
    field public static final int KEY_EAB_PROVISIONING_STATUS = 25; // 0x19
    field public static final int KEY_ENABLE_SILENT_REDIAL = 6; // 0x6
    field public static final int KEY_LOCAL_BREAKOUT_PCSCF_ADDRESS = 31; // 0x1f
    field public static final int KEY_LTE_EPDG_TIMER_SEC = 62; // 0x3e
    field public static final int KEY_LTE_THRESHOLD_1 = 56; // 0x38
    field public static final int KEY_LTE_THRESHOLD_2 = 57; // 0x39
    field public static final int KEY_LTE_THRESHOLD_3 = 58; // 0x3a
    field public static final int KEY_MINIMUM_SIP_SESSION_EXPIRATION_TIMER_SEC = 3; // 0x3
    field public static final int KEY_MOBILE_DATA_ENABLED = 29; // 0x1d
    field public static final int KEY_MULTIENDPOINT_ENABLED = 65; // 0x41
    field public static final int KEY_RCS_AVAILABILITY_CACHE_EXPIRATION_SEC = 19; // 0x13
    field public static final int KEY_RCS_CAPABILITIES_CACHE_EXPIRATION_SEC = 18; // 0x12
    field public static final int KEY_RCS_CAPABILITIES_POLL_INTERVAL_SEC = 20; // 0x14
    field public static final int KEY_RCS_CAPABILITY_DISCOVERY_ENABLED = 17; // 0x11
    field public static final int KEY_RCS_CAPABILITY_POLL_LIST_SUB_EXP_SEC = 23; // 0x17
    field public static final int KEY_RCS_MAX_NUM_ENTRIES_IN_RCL = 22; // 0x16
    field public static final int KEY_RCS_PUBLISH_SOURCE_THROTTLE_MS = 21; // 0x15
    field public static final int KEY_RCS_PUBLISH_TIMER_EXTENDED_SEC = 16; // 0x10
    field public static final int KEY_RCS_PUBLISH_TIMER_SEC = 15; // 0xf
    field public static final int KEY_REGISTRATION_DOMAIN_NAME = 12; // 0xc
    field public static final int KEY_REGISTRATION_RETRY_BASE_TIME_SEC = 33; // 0x21
    field public static final int KEY_REGISTRATION_RETRY_MAX_TIME_SEC = 34; // 0x22
    field public static final int KEY_RTP_SPEECH_END_PORT = 36; // 0x24
    field public static final int KEY_RTP_SPEECH_START_PORT = 35; // 0x23
    field public static final int KEY_RTT_ENABLED = 66; // 0x42
    field public static final int KEY_SIP_ACK_RECEIPT_WAIT_TIME_MS = 43; // 0x2b
    field public static final int KEY_SIP_ACK_RETRANSMIT_WAIT_TIME_MS = 44; // 0x2c
    field public static final int KEY_SIP_INVITE_ACK_WAIT_TIME_MS = 38; // 0x26
    field public static final int KEY_SIP_INVITE_CANCELLATION_TIMER_MS = 4; // 0x4
    field public static final int KEY_SIP_INVITE_REQUEST_TRANSMIT_INTERVAL_MS = 37; // 0x25
    field public static final int KEY_SIP_INVITE_RESPONSE_RETRANSMIT_INTERVAL_MS = 42; // 0x2a
    field public static final int KEY_SIP_INVITE_RESPONSE_RETRANSMIT_WAIT_TIME_MS = 39; // 0x27
    field public static final int KEY_SIP_KEEP_ALIVE_ENABLED = 32; // 0x20
    field public static final int KEY_SIP_NON_INVITE_REQUEST_RETRANSMISSION_WAIT_TIME_MS = 45; // 0x2d
    field public static final int KEY_SIP_NON_INVITE_REQUEST_RETRANSMIT_INTERVAL_MS = 40; // 0x28
    field public static final int KEY_SIP_NON_INVITE_RESPONSE_RETRANSMISSION_WAIT_TIME_MS = 46; // 0x2e
    field public static final int KEY_SIP_NON_INVITE_TRANSACTION_TIMEOUT_TIMER_MS = 41; // 0x29
    field public static final int KEY_SIP_SESSION_TIMER_SEC = 2; // 0x2
    field public static final int KEY_SMS_FORMAT = 13; // 0xd
    field public static final int KEY_SMS_OVER_IP_ENABLED = 14; // 0xe
    field public static final int KEY_SMS_PUBLIC_SERVICE_IDENTITY = 54; // 0x36
    field public static final int KEY_T1_TIMER_VALUE_MS = 7; // 0x7
    field public static final int KEY_T2_TIMER_VALUE_MS = 8; // 0x8
    field public static final int KEY_TF_TIMER_VALUE_MS = 9; // 0x9
    field public static final int KEY_TRANSITION_TO_LTE_DELAY_MS = 5; // 0x5
    field public static final int KEY_USE_GZIP_FOR_LIST_SUBSCRIPTION = 24; // 0x18
    field public static final int KEY_VIDEO_QUALITY = 55; // 0x37
    field public static final int KEY_VOICE_OVER_WIFI_ENABLED_OVERRIDE = 28; // 0x1c
    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 KEY_VOLTE_PROVISIONING_STATUS = 10; // 0xa
    field public static final int KEY_VOLTE_USER_OPT_IN_STATUS = 30; // 0x1e
    field public static final int KEY_VT_PROVISIONING_STATUS = 11; // 0xb
    field public static final int KEY_WIFI_EPDG_TIMER_SEC = 63; // 0x3f
    field public static final int KEY_WIFI_THRESHOLD_A = 60; // 0x3c
    field public static final int KEY_WIFI_THRESHOLD_B = 61; // 0x3d
    field public static final int PROVISIONING_RESULT_UNKNOWN = -1; // 0xffffffff
    field public static final int PROVISIONING_VALUE_DISABLED = 0; // 0x0
    field public static final int PROVISIONING_VALUE_ENABLED = 1; // 0x1
    field public static final int SMS_FORMAT_3GPP = 1; // 0x1
    field public static final int SMS_FORMAT_3GPP2 = 0; // 0x0
    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";
    field public static final int VIDEO_QUALITY_HIGH = 1; // 0x1
    field public static final int VIDEO_QUALITY_LOW = 0; // 0x0
  }

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

  public final class RcsContactUceCapability implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.List<java.lang.String> getCapableExtensionTags();
    method @NonNull public android.net.Uri getContactUri();
    method @Nullable public android.net.Uri getServiceUri(long);
    method public boolean isCapable(long);
    method public boolean isCapable(@NonNull String);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int CAPABILITY_CALL_COMPOSER = 4194304; // 0x400000
    field public static final int CAPABILITY_CHAT_BOT = 67108864; // 0x4000000
    field public static final int CAPABILITY_CHAT_BOT_ROLE = 134217728; // 0x8000000
    field public static final int CAPABILITY_CHAT_SESSION = 2; // 0x2
    field public static final int CAPABILITY_CHAT_SESSION_STORE_FORWARD = 4; // 0x4
    field public static final int CAPABILITY_CHAT_STANDALONE = 1; // 0x1
    field public static final int CAPABILITY_DISCOVERY_VIA_PRESENCE = 4096; // 0x1000
    field public static final int CAPABILITY_FILE_TRANSFER = 8; // 0x8
    field public static final int CAPABILITY_FILE_TRANSFER_HTTP = 64; // 0x40
    field public static final int CAPABILITY_FILE_TRANSFER_SMS = 128; // 0x80
    field public static final int CAPABILITY_FILE_TRANSFER_STORE_FORWARD = 32; // 0x20
    field public static final int CAPABILITY_FILE_TRANSFER_THUMBNAIL = 16; // 0x10
    field public static final int CAPABILITY_GEOLOCATION_PULL = 131072; // 0x20000
    field public static final int CAPABILITY_GEOLOCATION_PULL_FILE_TRANSFER = 262144; // 0x40000
    field public static final int CAPABILITY_GEOLOCATION_PUSH = 32768; // 0x8000
    field public static final int CAPABILITY_GEOLOCATION_PUSH_SMS = 65536; // 0x10000
    field public static final int CAPABILITY_IMAGE_SHARE = 256; // 0x100
    field public static final int CAPABILITY_IP_VIDEO_CALL = 16384; // 0x4000
    field public static final int CAPABILITY_IP_VOICE_CALL = 8192; // 0x2000
    field public static final int CAPABILITY_MMTEL_CALL_COMPOSER = 1073741824; // 0x40000000
    field public static final int CAPABILITY_PLUG_IN = 268435456; // 0x10000000
    field public static final int CAPABILITY_POST_CALL = 8388608; // 0x800000
    field public static final int CAPABILITY_RCS_VIDEO_CALL = 1048576; // 0x100000
    field public static final int CAPABILITY_RCS_VIDEO_ONLY_CALL = 2097152; // 0x200000
    field public static final int CAPABILITY_RCS_VOICE_CALL = 524288; // 0x80000
    field public static final int CAPABILITY_SHARED_MAP = 16777216; // 0x1000000
    field public static final int CAPABILITY_SHARED_SKETCH = 33554432; // 0x2000000
    field public static final int CAPABILITY_SOCIAL_PRESENCE = 2048; // 0x800
    field public static final int CAPABILITY_STANDALONE_CHAT_BOT = 536870912; // 0x20000000
    field public static final int CAPABILITY_VIDEO_SHARE = 1024; // 0x400
    field public static final int CAPABILITY_VIDEO_SHARE_DURING_CS_CALL = 512; // 0x200
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.RcsContactUceCapability> CREATOR;
  }

  public static class RcsContactUceCapability.Builder {
    ctor public RcsContactUceCapability.Builder(@NonNull android.net.Uri);
    method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(long, @NonNull android.net.Uri);
    method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(long);
    method @NonNull public android.telephony.ims.RcsContactUceCapability.Builder add(@NonNull String);
    method @NonNull public android.telephony.ims.RcsContactUceCapability build();
  }

  public class RcsUceAdapter {
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isUceSettingEnabled() throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUceSettingEnabled(boolean) throws android.telephony.ims.ImsException;
  }

}

package android.telephony.ims.feature {

  public final class CapabilityChangeRequest implements android.os.Parcelable {
    method public void addCapabilitiesToDisableForTech(int, int);
    method public void addCapabilitiesToEnableForTech(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 @NonNull public static final android.os.Parcelable.Creator<android.telephony.ims.feature.CapabilityChangeRequest> CREATOR;
  }

  public static class CapabilityChangeRequest.CapabilityPair {
    ctor public CapabilityChangeRequest.CapabilityPair(int, int);
    method 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 int getFeatureState();
    method public final int getSlotIndex();
    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
  }

  @Deprecated public static class ImsFeature.Capabilities {
    field @Deprecated 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(int, int);
    method @NonNull public final android.telephony.ims.feature.MmTelFeature.MmTelCapabilities queryCapabilityStatus();
    method public void setUiTtyMode(int, @Nullable android.os.Message);
    method public int shouldProcessCall(@NonNull String[]);
    field public static final String EXTRA_IS_UNKNOWN_CALL = "android.telephony.ims.feature.extra.IS_UNKNOWN_CALL";
    field public static final String EXTRA_IS_USSD = "android.telephony.ims.feature.extra.IS_USSD";
    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(int);
    method public final boolean isCapable(int);
    method public final void removeCapabilities(int);
  }

  public class RcsFeature extends android.telephony.ims.feature.ImsFeature {
    ctor public RcsFeature();
    method public void changeEnabledCapabilities(@NonNull android.telephony.ims.feature.CapabilityChangeRequest, @NonNull 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 void notifyRcsAutoConfigurationReceived(@NonNull byte[], boolean);
    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 @NonNull 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, @IntRange(from=0, to=65535) int, int);
    method public void acknowledgeSmsReport(int, @IntRange(from=0, to=65535) int, int);
    method public String getSmsFormat();
    method public void onReady();
    method @Deprecated public final void onSendSmsResult(int, @IntRange(from=0, to=65535) int, int, int) throws java.lang.RuntimeException;
    method public final void onSendSmsResultError(int, @IntRange(from=0, to=65535) int, int, int, int) throws java.lang.RuntimeException;
    method public final void onSendSmsResultSuccess(int, @IntRange(from=0, to=65535) int) throws java.lang.RuntimeException;
    method public final void onSmsReceived(int, String, byte[]) throws java.lang.RuntimeException;
    method @Deprecated public final void onSmsStatusReportReceived(int, @IntRange(from=0, to=65535) int, String, byte[]) throws java.lang.RuntimeException;
    method public final void onSmsStatusReportReceived(int, String, byte[]) throws java.lang.RuntimeException;
    method public void sendSms(int, @IntRange(from=0, to=65535) 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 RESULT_NO_NETWORK_ERROR = -1; // 0xffffffff
    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 updateCallBarringWithPassword(int, int, @Nullable String[], int, @NonNull String);
    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);
    field public static final int CALL_BARRING_ALL = 7; // 0x7
    field public static final int CALL_BARRING_ALL_INCOMING = 1; // 0x1
    field public static final int CALL_BARRING_ALL_OUTGOING = 2; // 0x2
    field public static final int CALL_BARRING_ANONYMOUS_INCOMING = 6; // 0x6
    field public static final int CALL_BARRING_INCOMING_ALL_SERVICES = 9; // 0x9
    field public static final int CALL_BARRING_OUTGOING_ALL_SERVICES = 8; // 0x8
    field public static final int CALL_BARRING_OUTGOING_INTL = 3; // 0x3
    field public static final int CALL_BARRING_OUTGOING_INTL_EXCL_HOME = 4; // 0x4
    field public static final int CALL_BARRING_SPECIFIC_INCOMING_CALLS = 10; // 0xa
    field public static final int CALL_BLOCKING_INCOMING_WHEN_ROAMING = 5; // 0x5
    field public static final int INVALID_RESULT = -1; // 0xffffffff
  }

}

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 @NonNull public static final android.os.Parcelable.Creator<android.telephony.mbms.UriPathPair> CREATOR;
  }

}

package android.telephony.mbms.vendor {

  public class MbmsDownloadServiceBase extends android.os.Binder implements android.os.IInterface {
    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 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 implements android.os.IInterface {
    ctor public MbmsStreamingServiceBase();
    method public android.os.IBinder asBinder();
    method public void dispose(int) throws android.os.RemoteException;
    method @Nullable public android.net.Uri getPlaybackUri(int, String) throws android.os.RemoteException;
    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();
  }

  public final class StatsEvent {
    method @NonNull public static android.util.StatsEvent.Builder newBuilder();
  }

  public static final class StatsEvent.Builder {
    method @NonNull public android.util.StatsEvent.Builder addBooleanAnnotation(byte, boolean);
    method @NonNull public android.util.StatsEvent.Builder addIntAnnotation(byte, int);
    method @NonNull public android.util.StatsEvent build();
    method @NonNull public android.util.StatsEvent.Builder setAtomId(int);
    method @NonNull public android.util.StatsEvent.Builder usePooledBuffer();
    method @NonNull public android.util.StatsEvent.Builder writeAttributionChain(@NonNull int[], @NonNull String[]);
    method @NonNull public android.util.StatsEvent.Builder writeBoolean(boolean);
    method @NonNull public android.util.StatsEvent.Builder writeByteArray(@NonNull byte[]);
    method @NonNull public android.util.StatsEvent.Builder writeFloat(float);
    method @NonNull public android.util.StatsEvent.Builder writeInt(int);
    method @NonNull public android.util.StatsEvent.Builder writeKeyValuePairs(@Nullable android.util.SparseIntArray, @Nullable android.util.SparseLongArray, @Nullable android.util.SparseArray<java.lang.String>, @Nullable android.util.SparseArray<java.lang.Float>);
    method @NonNull public android.util.StatsEvent.Builder writeLong(long);
    method @NonNull public android.util.StatsEvent.Builder writeString(@NonNull String);
  }

  public final class StatsLog {
    method public static void write(@NonNull android.util.StatsEvent);
    method public static void writeRaw(@NonNull byte[], int);
  }

}

package android.view {

  public abstract class Window {
    method public void addSystemFlags(@android.view.WindowManager.LayoutParams.SystemFlags int);
  }

  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);
    field @RequiresPermission(android.Manifest.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS) public static final int SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS = 524288; // 0x80000
    field @RequiresPermission(android.Manifest.permission.INTERNAL_SYSTEM_WINDOW) public static final int SYSTEM_FLAG_SHOW_FOR_ALL_USERS = 16; // 0x10
  }

  @IntDef(flag=true, prefix={"SYSTEM_FLAG_"}, value={android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS, android.view.WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface WindowManager.LayoutParams.SystemFlags {
  }

}

package android.view.accessibility {

  public final class AccessibilityManager {
    method public int getAccessibilityWindowId(@Nullable android.os.IBinder);
    method @RequiresPermission(android.Manifest.permission.MANAGE_ACCESSIBILITY) public void performAccessibilityShortcut();
    method @RequiresPermission(android.Manifest.permission.MANAGE_ACCESSIBILITY) public void registerSystemAction(@NonNull android.app.RemoteAction, int);
    method @RequiresPermission(android.Manifest.permission.MANAGE_ACCESSIBILITY) public void unregisterSystemAction(int);
  }

}

package android.view.autofill {

  public final class AutofillManager {
    method public void setAugmentedAutofillWhitelist(@Nullable java.util.Set<java.lang.String>, @Nullable java.util.Set<android.content.ComponentName>);
  }

}

package android.view.contentcapture {

  public final class ContentCaptureContext implements android.os.Parcelable {
    method @Nullable public android.content.ComponentName getActivityComponent();
    method public int getDisplayId();
    method public int getFlags();
    method @Nullable public android.view.contentcapture.ContentCaptureSessionId getParentSessionId();
    method public int getTaskId();
    field public static final int FLAG_DISABLED_BY_APP = 1; // 0x1
    field public static final int FLAG_DISABLED_BY_FLAG_SECURE = 2; // 0x2
    field public static final int FLAG_RECONNECTED = 4; // 0x4
  }

  public final class ContentCaptureEvent implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.view.contentcapture.ContentCaptureContext getContentCaptureContext();
    method public long getEventTime();
    method @Nullable public android.view.autofill.AutofillId getId();
    method @Nullable public java.util.List<android.view.autofill.AutofillId> getIds();
    method @Nullable public CharSequence getText();
    method public int getType();
    method @Nullable public android.view.contentcapture.ViewNode getViewNode();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.view.contentcapture.ContentCaptureEvent> CREATOR;
    field public static final int TYPE_CONTEXT_UPDATED = 6; // 0x6
    field public static final int TYPE_SESSION_PAUSED = 8; // 0x8
    field public static final int TYPE_SESSION_RESUMED = 7; // 0x7
    field public static final int TYPE_VIEW_APPEARED = 1; // 0x1
    field public static final int TYPE_VIEW_DISAPPEARED = 2; // 0x2
    field public static final int TYPE_VIEW_TEXT_CHANGED = 3; // 0x3
    field public static final int TYPE_VIEW_TREE_APPEARED = 5; // 0x5
    field public static final int TYPE_VIEW_TREE_APPEARING = 4; // 0x4
  }

  public final class ContentCaptureManager {
    method public boolean isContentCaptureFeatureEnabled();
  }

  public abstract class ContentCaptureSession implements java.lang.AutoCloseable {
    field public static final int NO_SESSION_ID = 0; // 0x0
  }

  public final class ViewNode extends android.app.assist.AssistStructure.ViewNode {
    method @Nullable public android.view.autofill.AutofillId getParentAutofillId();
  }

}

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 interface PacProcessor {
    method @Nullable public String findProxyForUrl(@NonNull String);
    method @NonNull public static android.webkit.PacProcessor getInstance();
    method public boolean setProxyScript(@NonNull String);
  }

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

  @Deprecated public abstract class TokenBindingService {
    ctor @Deprecated public TokenBindingService();
  }

  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 @Deprecated public void callDrawGlFunction(android.graphics.Canvas, long);
    method @Deprecated public void callDrawGlFunction(@NonNull android.graphics.Canvas, long, @Nullable Runnable);
    method @Deprecated public boolean canInvokeDrawGlFunctor(android.view.View);
    method @Deprecated public void detachDrawGlFunctor(android.view.View, long);
    method public void drawWebViewFunctor(@NonNull android.graphics.Canvas, int);
    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 @Deprecated 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 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 @NonNull public default android.webkit.PacProcessor getPacProcessor();
    method public android.webkit.ServiceWorkerController getServiceWorkerController();
    method public android.webkit.WebViewFactoryProvider.Statics getStatics();
    method @Deprecated 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 @Nullable public android.webkit.WebViewRenderProcess getWebViewRenderProcess();
    method @Nullable public android.webkit.WebViewRenderProcessClient getWebViewRenderProcessClient();
    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 void setWebViewRenderProcessClient(@Nullable java.util.concurrent.Executor, @Nullable android.webkit.WebViewRenderProcessClient);
    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 default void onProvideContentCaptureStructure(@NonNull 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 @NonNull 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();
  }

}

