// Signature format: 2.0
package android {

  public static final class Manifest.permission {
    field public static final String ACCESS_AMBIENT_LIGHT_STATS = "android.permission.ACCESS_AMBIENT_LIGHT_STATS";
    field public static final String ACCESS_BROADCAST_RADIO = "android.permission.ACCESS_BROADCAST_RADIO";
    field public static final String ACCESS_CACHE_FILESYSTEM = "android.permission.ACCESS_CACHE_FILESYSTEM";
    field public static final String ACCESS_DRM_CERTIFICATES = "android.permission.ACCESS_DRM_CERTIFICATES";
    field @Deprecated public static final String ACCESS_FM_RADIO = "android.permission.ACCESS_FM_RADIO";
    field public static final String ACCESS_INSTANT_APPS = "android.permission.ACCESS_INSTANT_APPS";
    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 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 CHANGE_APP_IDLE_STATE = "android.permission.CHANGE_APP_IDLE_STATE";
    field public static final String CHANGE_DEVICE_IDLE_TEMP_WHITELIST = "android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST";
    field public static final String CLEAR_APP_USER_DATA = "android.permission.CLEAR_APP_USER_DATA";
    field public static final String CONFIGURE_DISPLAY_BRIGHTNESS = "android.permission.CONFIGURE_DISPLAY_BRIGHTNESS";
    field public static final String 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_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 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_PROFILES = "android.permission.INTERACT_ACROSS_PROFILES";
    field public static final String INTERACT_ACROSS_USERS = "android.permission.INTERACT_ACROSS_USERS";
    field public static final String INTERACT_ACROSS_USERS_FULL = "android.permission.INTERACT_ACROSS_USERS_FULL";
    field public static final String INTERNAL_SYSTEM_WINDOW = "android.permission.INTERNAL_SYSTEM_WINDOW";
    field public static final String INVOKE_CARRIER_SETUP = "android.permission.INVOKE_CARRIER_SETUP";
    field public static final String KILL_UID = "android.permission.KILL_UID";
    field public static final String LOCAL_MAC_ADDRESS = "android.permission.LOCAL_MAC_ADDRESS";
    field public static final String 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_IPSEC_TUNNELS = "android.permission.MANAGE_IPSEC_TUNNELS";
    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 MOVE_PACKAGE = "android.permission.MOVE_PACKAGE";
    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 READ_ACTIVE_EMERGENCY_SESSION = "android.permission.READ_ACTIVE_EMERGENCY_SESSION";
    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 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_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 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 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
  }

  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 requiredSystemPropertyName = 16844133; // 0x1010565
    field public static final int requiredSystemPropertyValue = 16844134; // 0x1010566
    field public static final int resourcesMap = 16844297; // 0x1010609
    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
    field public static final int stat_notify_wifi_in_range = 17301685; // 0x10800b5
  }

  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 notification_channel_network_alerts = 17039398; // 0x1040026
    field public static final int notification_channel_network_available = 17039399; // 0x1040027
    field public static final int notification_channel_network_status = 17039397; // 0x1040025
  }

  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(android.Manifest.permission.KILL_UID) public void killUid(int, String);
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void removeOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener);
    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);
  }

  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 @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(String, int, String, int);
    method @RequiresPermission("android.permission.MANAGE_APP_OPS_MODES") public void setUidMode(String, int, int);
    field public static final String OPSTR_ACCEPT_HANDOVER = "android:accept_handover";
    field public static final String OPSTR_ACCESS_ACCESSIBILITY = "android:access_accessibility";
    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_LEGACY_STORAGE = "android:legacy_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_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.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 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 @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 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 public long getLastDuration(int, int, int);
    method public long getLastForegroundDuration(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 @Nullable public String getProxyPackageName(int, int);
    method @Deprecated public int getProxyUid();
    method 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.OpFeatureEntry {
    method public long getDuration();
    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 public long getLastDuration(int, int, int);
    method public long getLastForegroundDuration(int);
    method public long getLastRejectBackgroundTime(int);
    method public long getLastRejectForegroundTime(int);
    method public long getLastRejectTime(int);
    method public long getLastRejectTime(int, int, int);
    method @Nullable public String getProxyFeatureId();
    method @Nullable public String getProxyFeatureId(int, int);
    method @Nullable public String getProxyPackageName();
    method @Nullable public String getProxyPackageName(int, int);
    method public int getProxyUid();
    method public int getProxyUid(int, int);
    method public boolean isRunning();
  }

  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(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 {
    field public static final String ACTION_DOWNLOAD_COMPLETED = "android.intent.action.DOWNLOAD_COMPLETED";
  }

  public abstract class InstantAppResolverService extends android.app.Service {
    ctor public InstantAppResolverService();
    method public final void attachBaseContext(android.content.Context);
    method public final android.os.IBinder onBind(android.content.Intent);
    method @Deprecated public void onGetInstantAppIntentFilter(@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 public void onGetInstantAppIntentFilter(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @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 public void onGetInstantAppResolveInfo(@NonNull android.content.Intent, @Nullable int[], @NonNull android.os.UserHandle, @NonNull String, @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.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.Manifest.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS) public void setPrivateNotificationsAllowed(boolean);
  }

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

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

  public final class NotificationChannel implements android.os.Parcelable {
    method public int getUserLockedFields();
    method public boolean isDeleted();
    method public void populateFromXml(org.xmlpull.v1.XmlPullParser);
    method public org.json.JSONObject toJson() throws org.json.JSONException;
    method public void writeXml(org.xmlpull.v1.XmlSerializer) throws java.io.IOException;
    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 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(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;
    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";
  }

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

  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 @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 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 @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_MANAGED_DEVICE_FROM_TRUSTED_SOURCE = "android.app.action.PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE";
    field public static final String ACTION_SET_PROFILE_OWNER = "android.app.action.SET_PROFILE_OWNER";
    field public static final String ACTION_STATE_USER_SETUP_COMPLETE = "android.app.action.STATE_USER_SETUP_COMPLETE";
    field public static final String EXTRA_PROFILE_OWNER_NAME = "android.app.extra.PROFILE_OWNER_NAME";
    field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_ICON_URI = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_ICON_URI";
    field public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_LABEL = "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_LABEL";
    field public static final String EXTRA_PROVISIONING_ORGANIZATION_NAME = "android.app.extra.PROVISIONING_ORGANIZATION_NAME";
    field public static final String EXTRA_PROVISIONING_SUPPORT_URL = "android.app.extra.PROVISIONING_SUPPORT_URL";
    field public static final 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.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_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.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(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 @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 @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 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(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 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_ADMIN) public boolean connectAllEnabledProfiles(@NonNull android.bluetooth.BluetoothDevice);
    method public boolean disableBLE();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) 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 removeOnMetadataChangedListener(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.BluetoothAdapter.OnMetadataChangedListener);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setActiveDevice(@Nullable android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) public boolean setScanMode(int, int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH) 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 BluetoothDevice implements android.os.Parcelable {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean cancelBondProcess();
    method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public byte[] getMetadata(int);
    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) public boolean setAlias(@NonNull String);
    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_PRIVILEGED) public boolean setSilenceMode(boolean);
    field public static final int ACCESS_ALLOWED = 1; // 0x1
    field public static final int ACCESS_REJECTED = 2; // 0x2
    field public static final int ACCESS_UNKNOWN = 0; // 0x0
    field public static final String ACTION_SILENCE_MODE_CHANGED = "android.bluetooth.device.action.SILENCE_MODE_CHANGED";
    field public static final 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 @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN) public boolean setPriority(android.bluetooth.BluetoothDevice, int);
  }

  public final class BluetoothPan implements android.bluetooth.BluetoothProfile {
    method protected void finalize();
    method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method public int getConnectionState(@Nullable android.bluetooth.BluetoothDevice);
    method public boolean isTetheringOn();
    method public void setBluetoothTethering(boolean);
    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 interface BluetoothProfile {
    field public static final int PAN = 5; // 0x5
    field public static final int PRIORITY_OFF = 0; // 0x0
    field public static final int PRIORITY_ON = 100; // 0x64
  }

}

package android.bluetooth.le {

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

  public final class ResultStorageDescriptor implements android.os.Parcelable {
    ctor public ResultStorageDescriptor(int, int, int);
    method public int describeContents();
    method public int getLength();
    method public int getOffset();
    method public int getType();
    method public void writeToParcel(android.os.Parcel, int);
    field @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 isDeviceAssociated(@NonNull String, @NonNull android.net.MacAddress, @NonNull android.os.UserHandle);
  }

}

package android.content {

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

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

  public abstract class ContentResolver {
    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 @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public boolean bindServiceAsUser(@RequiresPermission android.content.Intent, android.content.ServiceConnection, int, android.os.UserHandle);
    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_FULL) 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 EUICC_CARD_SERVICE = "euicc_card";
    field public static final String HDMI_CONTROL_SERVICE = "hdmi_control";
    field public static final String NETD_SERVICE = "netd";
    field public static final String NETWORK_SCORE_SERVICE = "network_score";
    field public static final String OEM_LOCK_SERVICE = "oem_lock";
    field public static final String 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_UPDATE_SERVICE = "system_update";
    field public static final String TELEPHONY_REGISTRY_SERVICE = "telephony_registry";
    field public static final String VR_SERVICE = "vrmanager";
    field @Deprecated public static final String WIFI_RTT_SERVICE = "rttmanager";
    field public static final String WIFI_SCANNING_SERVICE = "wifiscanner";
  }

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

  public class 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 @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_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 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 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 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 String METADATA_SETUP_VERSION = "android.SETUP_VERSION";
  }

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

}

package android.content.integrity {

  public final class AppInstallMetadata {
    method @NonNull public String getAppCertificate();
    method @Nullable public String getInstallerCertificate();
    method @Nullable public String getInstallerName();
    method @NonNull public String getPackageName();
    method public int getVersionCode();
    method public boolean isPreInstalled();
  }

  public static final class AppInstallMetadata.Builder {
    ctor public AppInstallMetadata.Builder();
    method @NonNull public android.content.integrity.AppInstallMetadata build();
    method @NonNull public android.content.integrity.AppInstallMetadata.Builder setAppCertificate(@NonNull String);
    method @NonNull public android.content.integrity.AppInstallMetadata.Builder setInstallerCertificate(@NonNull String);
    method @NonNull public android.content.integrity.AppInstallMetadata.Builder setInstallerName(@NonNull String);
    method @NonNull public android.content.integrity.AppInstallMetadata.Builder setIsPreInstalled(boolean);
    method @NonNull public android.content.integrity.AppInstallMetadata.Builder setPackageName(@NonNull String);
    method @NonNull public android.content.integrity.AppInstallMetadata.Builder setVersionCode(int);
  }

  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 AtomicFormula implements android.content.integrity.Formula {
    ctor public AtomicFormula(@android.content.integrity.AtomicFormula.Key int);
    method public int getKey();
    field public static final int APP_CERTIFICATE = 1; // 0x1
    field public static final int EQ = 0; // 0x0
    field public static final int GE = 4; // 0x4
    field public static final int GT = 3; // 0x3
    field public static final int INSTALLER_CERTIFICATE = 3; // 0x3
    field public static final int INSTALLER_NAME = 2; // 0x2
    field public static final int LE = 2; // 0x2
    field public static final int LT = 1; // 0x1
    field public static final int PACKAGE_NAME = 0; // 0x0
    field public static final int PRE_INSTALLED = 5; // 0x5
    field public static final int VERSION_CODE = 4; // 0x4
  }

  public static final class AtomicFormula.BooleanAtomicFormula extends android.content.integrity.AtomicFormula implements android.os.Parcelable {
    ctor public AtomicFormula.BooleanAtomicFormula(@android.content.integrity.AtomicFormula.Key int, boolean);
    method public int describeContents();
    method public int getTag();
    method public boolean getValue();
    method public boolean isSatisfied(@NonNull android.content.integrity.AppInstallMetadata);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.integrity.AtomicFormula.BooleanAtomicFormula> CREATOR;
  }

  public static final class AtomicFormula.IntAtomicFormula extends android.content.integrity.AtomicFormula implements android.os.Parcelable {
    ctor public AtomicFormula.IntAtomicFormula(@android.content.integrity.AtomicFormula.Key int, @android.content.integrity.AtomicFormula.Operator int, int);
    method public int describeContents();
    method public int getOperator();
    method public int getTag();
    method public int getValue();
    method public boolean isSatisfied(@NonNull android.content.integrity.AppInstallMetadata);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.integrity.AtomicFormula.IntAtomicFormula> CREATOR;
  }

  @IntDef({android.content.integrity.AtomicFormula.PACKAGE_NAME, android.content.integrity.AtomicFormula.APP_CERTIFICATE, android.content.integrity.AtomicFormula.INSTALLER_NAME, android.content.integrity.AtomicFormula.INSTALLER_CERTIFICATE, android.content.integrity.AtomicFormula.VERSION_CODE, android.content.integrity.AtomicFormula.PRE_INSTALLED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface AtomicFormula.Key {
  }

  @IntDef({android.content.integrity.AtomicFormula.EQ, android.content.integrity.AtomicFormula.LT, android.content.integrity.AtomicFormula.LE, android.content.integrity.AtomicFormula.GT, android.content.integrity.AtomicFormula.GE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface AtomicFormula.Operator {
  }

  public static final class AtomicFormula.StringAtomicFormula extends android.content.integrity.AtomicFormula implements android.os.Parcelable {
    ctor public AtomicFormula.StringAtomicFormula(@android.content.integrity.AtomicFormula.Key int, @NonNull String, boolean);
    method public int describeContents();
    method public boolean getIsHashedValue();
    method public int getTag();
    method @NonNull public String getValue();
    method public boolean isSatisfied(@NonNull android.content.integrity.AppInstallMetadata);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.content.integrity.AtomicFormula.StringAtomicFormula> CREATOR;
  }

  public final class CompoundFormula implements android.content.integrity.Formula android.os.Parcelable {
    ctor public CompoundFormula(@android.content.integrity.CompoundFormula.Connector int, @NonNull java.util.List<android.content.integrity.Formula>);
    method public int describeContents();
    method @android.content.integrity.CompoundFormula.Connector public int getConnector();
    method @NonNull public java.util.List<android.content.integrity.Formula> getFormulas();
    method public int getTag();
    method public boolean isSatisfied(@NonNull android.content.integrity.AppInstallMetadata);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int AND = 0; // 0x0
    field @NonNull public static final android.os.Parcelable.Creator<android.content.integrity.CompoundFormula> CREATOR;
    field public static final int NOT = 2; // 0x2
    field public static final int OR = 1; // 0x1
  }

  @IntDef({android.content.integrity.CompoundFormula.AND, android.content.integrity.CompoundFormula.OR, android.content.integrity.CompoundFormula.NOT}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CompoundFormula.Connector {
  }

  public interface Formula {
    method @android.content.integrity.Formula.Tag public int getTag();
    method public boolean isSatisfied(@NonNull android.content.integrity.AppInstallMetadata);
    method @NonNull public static android.content.integrity.Formula readFromParcel(@NonNull android.os.Parcel);
    method public static void writeToParcel(@NonNull android.content.integrity.Formula, @NonNull android.os.Parcel, int);
    field public static final int BOOLEAN_ATOMIC_FORMULA_TAG = 3; // 0x3
    field public static final int COMPOUND_FORMULA_TAG = 0; // 0x0
    field public static final int INT_ATOMIC_FORMULA_TAG = 2; // 0x2
    field public static final int STRING_ATOMIC_FORMULA_TAG = 1; // 0x1
  }

  @IntDef({android.content.integrity.Formula.COMPOUND_FORMULA_TAG, android.content.integrity.Formula.STRING_ATOMIC_FORMULA_TAG, android.content.integrity.Formula.INT_ATOMIC_FORMULA_TAG, android.content.integrity.Formula.BOOLEAN_ATOMIC_FORMULA_TAG}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface Formula.Tag {
  }

  public final class Rule implements android.os.Parcelable {
    ctor public Rule(@NonNull android.content.integrity.Formula, @android.content.integrity.Rule.Effect int);
    method public int describeContents();
    method @android.content.integrity.Rule.Effect public int getEffect();
    method @NonNull public android.content.integrity.Formula 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
  }

  @IntDef({android.content.integrity.Rule.DENY, android.content.integrity.Rule.FORCE_ALLOW}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface Rule.Effect {
  }

  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);
    method @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public void setEnabledExclusiveInCategory(@NonNull String, @NonNull android.os.UserHandle);
  }

}

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 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 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 class PackageInstaller {
    method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean);
  }

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

  public static class PackageInstaller.SessionInfo implements android.os.Parcelable {
    method public boolean getAllocateAggressive();
    method @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 @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 public void setDontKillApp(boolean);
    method public void setEnableRollback(boolean);
    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 @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_TELEPHONY_CARRIERLOCK = "android.hardware.telephony.carrierlock";
    field public static final int FLAG_PERMISSION_APPLY_RESTRICTION = 16384; // 0x4000
    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_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_INSTANT = 8388608; // 0x800000
    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
  }

  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}) @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_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_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 @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 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.hardware {

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

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

}

package android.hardware.camera2 {

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

}

package android.hardware.camera2.params {

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

}

package android.hardware.display {

  public final class AmbientBrightnessDayStats implements android.os.Parcelable {
    method public int describeContents();
    method public float[] getBucketBoundaries();
    method public java.time.LocalDate getLocalDate();
    method public float[] getStats();
    method public void writeToParcel(android.os.Parcel, int);
    field @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 boolean shouldCollectColorSamples();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.display.BrightnessConfiguration> CREATOR;
  }

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

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

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

  public class ContextHubInfo implements android.os.Parcelable {
    ctor public ContextHubInfo();
    method public int describeContents();
    method public byte getChreApiMajorVersion();
    method public byte getChreApiMinorVersion();
    method public short getChrePatchVersion();
    method public long getChrePlatformId();
    method public int getId();
    method public int getMaxPacketLengthBytes();
    method public android.hardware.location.MemoryRegion[] getMemoryRegions();
    method public String getName();
    method public float getPeakMips();
    method public float getPeakPowerDrawMw();
    method public int getPlatformVersion();
    method public float getSleepPowerDrawMw();
    method public int getStaticSwVersion();
    method public float getStoppedPowerDrawMw();
    method public int[] getSupportedSensors();
    method public String getToolchain();
    method public int getToolchainVersion();
    method public String getVendor();
    method public void writeToParcel(android.os.Parcel, int);
    field @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(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.ContextHubClientCallback, @NonNull java.util.concurrent.Executor);
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.ContextHubClientCallback);
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.ContextHubClient createClient(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.app.PendingIntent, long);
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.ContextHubTransaction<java.lang.Void> disableNanoApp(@NonNull android.hardware.location.ContextHubInfo, long);
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.ContextHubTransaction<java.lang.Void> enableNanoApp(@NonNull android.hardware.location.ContextHubInfo, long);
    method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int[] findNanoAppOnHub(int, @NonNull android.hardware.location.NanoAppFilter);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int[] getContextHubHandles();
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.ContextHubInfo getContextHubInfo(int);
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<android.hardware.location.ContextHubInfo> getContextHubs();
    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.NanoAppInstanceInfo getNanoAppInstanceInfo(int);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int loadNanoApp(int, @NonNull android.hardware.location.NanoApp);
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.ContextHubTransaction<java.lang.Void> loadNanoApp(@NonNull android.hardware.location.ContextHubInfo, @NonNull android.hardware.location.NanoAppBinary);
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public android.hardware.location.ContextHubTransaction<java.util.List<android.hardware.location.NanoAppState>> queryNanoApps(@NonNull android.hardware.location.ContextHubInfo);
    method @Deprecated public int registerCallback(@NonNull android.hardware.location.ContextHubManager.Callback);
    method @Deprecated public int registerCallback(android.hardware.location.ContextHubManager.Callback, android.os.Handler);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int sendMessage(int, int, @NonNull android.hardware.location.ContextHubMessage);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public int unloadNanoApp(int);
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) 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 STATUS_OK = 0; // 0x0
  }

  public static final class SoundTrigger.ModuleProperties 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.soundtrigger.SoundTrigger.ModuleProperties> CREATOR;
    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 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();
  }

}

package android.hardware.usb {

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

  public class UsbManager {
    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);
    field @RequiresPermission(android.Manifest.permission.MANAGE_USB) public static final String ACTION_USB_PORT_CHANGED = "android.hardware.usb.action.USB_PORT_CHANGED";
  }

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

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

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

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

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

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

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

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

  public class Location implements android.os.Parcelable {
    method public boolean isComplete();
    method public void makeComplete();
    method public void setExtraLocation(@Nullable String, @Nullable android.location.Location);
    method public void setIsFromMockProvider(boolean);
    field 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 @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public android.location.GnssCapabilities getGnssCapabilities();
    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(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();
    field public static final int FLAG_BEACON = 8; // 0x8
    field public static final int FLAG_BYPASS_INTERRUPTION_POLICY = 64; // 0x40
    field public static final int FLAG_BYPASS_MUTE = 128; // 0x80
    field public static final int FLAG_HW_HOTWORD = 32; // 0x20
  }

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

  public final class AudioDeviceAddress implements android.os.Parcelable {
    ctor public AudioDeviceAddress(@NonNull android.media.AudioDeviceInfo);
    ctor public AudioDeviceAddress(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.AudioDeviceAddress> CREATOR;
    field public static final int ROLE_INPUT = 1; // 0x1
    field public static final int ROLE_OUTPUT = 2; // 0x2
  }

  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 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 @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 @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 @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_PHONE_STATE) public int requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, @NonNull android.media.AudioAttributes, int, int) throws java.lang.IllegalArgumentException;
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.MODIFY_AUDIO_ROUTING}) public int requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, @NonNull android.media.AudioAttributes, int, int, android.media.audiopolicy.AudioPolicy) throws java.lang.IllegalArgumentException;
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int requestAudioFocus(@NonNull android.media.AudioFocusRequest, @Nullable android.media.audiopolicy.AudioPolicy);
    method public void setAudioServerStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.AudioServerStateCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void setFocusRequestResult(@NonNull android.media.AudioFocusInfo, int, @NonNull android.media.audiopolicy.AudioPolicy);
    method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void 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 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 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();
    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 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.audiopolicy {

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

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

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

  public static class AudioMixingRule.Builder {
    ctor public AudioMixingRule.Builder();
    method public android.media.audiopolicy.AudioMixingRule.Builder addMixRule(int, Object) throws java.lang.IllegalArgumentException;
    method public android.media.audiopolicy.AudioMixingRule.Builder addRule(android.media.AudioAttributes, int) throws java.lang.IllegalArgumentException;
    method @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 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 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 public int describeContents();
    method @NonNull public android.media.AudioAttributes getAudioAttributes();
    method public int getId();
    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 registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.session.MediaSessionManager.Callback);
    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);
    method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void unregisterCallback(@NonNull android.media.session.MediaSessionManager.Callback);
  }

  public abstract static class MediaSessionManager.Callback {
    ctor public MediaSessionManager.Callback();
    method public abstract void onAddressedPlayerChanged(android.media.session.MediaSession.Token);
    method public abstract void onAddressedPlayerChanged(android.content.ComponentName);
    method public abstract void onMediaKeyEventDispatched(android.view.KeyEvent, android.media.session.MediaSession.Token);
    method public abstract void onMediaKeyEventDispatched(android.view.KeyEvent, android.content.ComponentName);
  }

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

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

}

package android.media.soundtrigger {

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

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

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

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

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

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

}

package android.media.tv {

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

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

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

  public final class TvInputHardwareInfo implements android.os.Parcelable {
    method public int describeContents();
    method public String getAudioAddress();
    method public int getAudioType();
    method public int getCableConnectionStatus();
    method public int getDeviceId();
    method public int getHdmiPortId();
    method public int getType();
    method public void readFromParcel(android.os.Parcel);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int CABLE_CONNECTION_STATUS_CONNECTED = 1; // 0x1
    field public static final int CABLE_CONNECTION_STATUS_DISCONNECTED = 2; // 0x2
    field public static final int CABLE_CONNECTION_STATUS_UNKNOWN = 0; // 0x0
    field @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, android.media.tv.TvInputInfo, android.media.tv.TvInputManager.HardwareCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void addBlockedRating(@NonNull android.media.tv.TvContentRating);
    method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public boolean captureFrame(String, android.view.Surface, android.media.tv.TvStreamConfig);
    method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public java.util.List<android.media.tv.TvStreamConfig> getAvailableTvStreamConfigList(String);
    method @RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE) public java.util.List<android.media.tv.TvInputHardwareInfo> getHardwareList();
    method @RequiresPermission(android.Manifest.permission.READ_CONTENT_RATING_SYSTEMS) public java.util.List<android.media.tv.TvContentRatingSystemInfo> getTvContentRatingSystemList();
    method @RequiresPermission(android.Manifest.permission.CAPTURE_TV_INPUT) public boolean isSingleSessionActive();
    method @RequiresPermission(android.Manifest.permission.NOTIFY_TV_INPUTS) public void notifyPreviewProgramAddedToWatchNext(String, long, long);
    method @RequiresPermission(android.Manifest.permission.NOTIFY_TV_INPUTS) public void notifyPreviewProgramBrowsableDisabled(String, long);
    method @RequiresPermission(android.Manifest.permission.NOTIFY_TV_INPUTS) public void notifyWatchNextProgramBrowsableDisabled(String, long);
    method @RequiresPermission(android.Manifest.permission.TV_INPUT_HARDWARE) public void releaseTvInputHardware(int, android.media.tv.TvInputManager.Hardware);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void removeBlockedRating(@NonNull android.media.tv.TvContentRating);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PARENTAL_CONTROLS) public void setParentalControlsEnabled(boolean);
  }

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

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

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

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

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

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

  public class TvStreamConfig implements android.os.Parcelable {
    method public int describeContents();
    method public int getGeneration();
    method public int getMaxHeight();
    method public int getMaxWidth();
    method public int getStreamId();
    method public int getType();
    method public void writeToParcel(android.os.Parcel, int);
    field @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.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 public void useNetwork();
    field public static final int APP_RETURN_DISMISSED = 0; // 0x0
    field public static final int APP_RETURN_UNWANTED = 1; // 0x1
    field public static final int APP_RETURN_WANTED_AS_IS = 2; // 0x2
  }

  public class ConnectivityManager {
    method @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 @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void getLatestTetheringEntitlementResult(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityManager.OnTetheringEntitlementResultListener);
    method @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public boolean isTetheringSupported();
    method @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void registerTetheringEventCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityManager.OnTetheringEventCallback);
    method @RequiresPermission(anyOf={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 @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int, boolean, android.net.ConnectivityManager.OnStartTetheringCallback);
    method @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int, boolean, android.net.ConnectivityManager.OnStartTetheringCallback, android.os.Handler);
    method @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void stopTethering(int);
    method @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 public static final int TETHER_ERROR_ENTITLEMENT_UNKONWN = 13; // 0xd
    field public static final int TETHER_ERROR_NO_ERROR = 0; // 0x0
    field public static final int TETHER_ERROR_PROVISION_FAILED = 11; // 0xb
  }

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

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

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

  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 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);
    ctor public LinkAddress(@NonNull String);
    ctor public LinkAddress(@NonNull String, int, int);
    method public boolean isGlobalPreferred();
    method public boolean isIpv4();
    method public boolean isIpv6();
    method public boolean isSameAddressAs(@Nullable android.net.LinkAddress);
  }

  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 @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 hasIpv6DefaultRoute();
    method public boolean isIpv4Provisioned();
    method public boolean isIpv6Provisioned();
    method public boolean isProvisioned();
    method public boolean isReachable(@NonNull java.net.InetAddress);
    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 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 class Network implements android.os.Parcelable {
    ctor public Network(@NonNull android.net.Network);
    method @NonNull public android.net.Network getPrivateDnsBypassingCopy();
  }

  public final class NetworkCapabilities implements android.os.Parcelable {
    method @NonNull public int[] getTransportTypes();
    method public boolean satisfiedByNetworkCapabilities(@Nullable android.net.NetworkCapabilities);
    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(@Nullable 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 abstract class NetworkRecommendationProvider {
    ctor public NetworkRecommendationProvider(android.content.Context, java.util.concurrent.Executor);
    method public final android.os.IBinder getBinder();
    method public abstract void onRequestScores(android.net.NetworkKey[]);
  }

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

  public class NetworkScoreManager {
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, "android.permission.REQUEST_NETWORK_SCORES"}) public boolean clearScores() throws java.lang.SecurityException;
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, "android.permission.REQUEST_NETWORK_SCORES"}) public void disableScoring() throws java.lang.SecurityException;
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, "android.permission.REQUEST_NETWORK_SCORES"}) public String getActiveScorerPackage();
    method @RequiresPermission("android.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.permission.REQUEST_NETWORK_SCORES") public boolean requestScores(@NonNull android.net.NetworkKey[]) throws java.lang.SecurityException;
    method @RequiresPermission(anyOf={android.Manifest.permission.SCORE_NETWORKS, "android.permission.REQUEST_NETWORK_SCORES"}) public boolean setActiveScorer(String) throws java.lang.SecurityException;
    method @RequiresPermission(android.Manifest.permission.SCORE_NETWORKS) public boolean updateScores(@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";
  }

  public static interface NetworkScoreManager.NetworkScoreCallback {
    method public void clearScores();
    method public void updateScores(@NonNull java.util.List<android.net.ScoredNetwork>);
  }

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

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

  public class RssiCurve implements android.os.Parcelable {
    ctor public RssiCurve(int, int, byte[]);
    ctor public RssiCurve(int, int, byte[], int);
    method public int describeContents();
    method public byte lookupScore(int);
    method public byte lookupScore(int, boolean);
    method public void writeToParcel(android.os.Parcel, int);
    field @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 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 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.LinkAddress> getInternalSubnets();
    method @NonNull public java.util.List<android.net.ipsec.ike.IkeTrafficSelector> getOutboundTrafficSelectors();
  }

  public abstract class ChildSessionOptions {
  }

  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.IkeSessionOptions, @NonNull android.net.ipsec.ike.ChildSessionOptions, @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.ChildSessionOptions, @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 {
    ctor public IkeSessionConfiguration();
    method @NonNull public String getRemoteApplicationVersion();
    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 IkeSessionOptions {
  }

  public static final class IkeSessionOptions.Builder {
    ctor public IkeSessionOptions.Builder();
    method @NonNull public android.net.ipsec.ike.IkeSessionOptions.Builder addSaProposal(@NonNull android.net.ipsec.ike.IkeSaProposal);
    method @NonNull public android.net.ipsec.ike.IkeSessionOptions build();
    method @NonNull public android.net.ipsec.ike.IkeSessionOptions.Builder setAuthDigitalSignature(@NonNull java.security.cert.X509Certificate, @NonNull java.security.cert.X509Certificate, @NonNull java.security.PrivateKey);
    method @NonNull public android.net.ipsec.ike.IkeSessionOptions.Builder setAuthDigitalSignature(@NonNull 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.IkeSessionOptions.Builder setAuthEap(@NonNull java.security.cert.X509Certificate, @NonNull android.net.eap.EapSessionConfig);
    method @NonNull public android.net.ipsec.ike.IkeSessionOptions.Builder setAuthPsk(@NonNull byte[]);
    method @NonNull public android.net.ipsec.ike.IkeSessionOptions.Builder setLocalIdentification(@NonNull android.net.ipsec.ike.IkeIdentification);
    method @NonNull public android.net.ipsec.ike.IkeSessionOptions.Builder setRemoteIdentification(@NonNull android.net.ipsec.ike.IkeIdentification);
    method @NonNull public android.net.ipsec.ike.IkeSessionOptions.Builder setServerAddress(@NonNull java.net.InetAddress);
    method @NonNull public android.net.ipsec.ike.IkeSessionOptions.Builder setUdpEncapsulationSocket(@NonNull android.net.IpSecManager.UdpEncapsulationSocket);
  }

  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 TransportModeChildSessionOptions extends android.net.ipsec.ike.ChildSessionOptions {
  }

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

  public final class TunnelModeChildSessionOptions extends android.net.ipsec.ike.ChildSessionOptions {
  }

  public static final class TunnelModeChildSessionOptions.Builder {
    ctor public TunnelModeChildSessionOptions.Builder();
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions.Builder addInboundTrafficSelectors(@NonNull android.net.ipsec.ike.IkeTrafficSelector);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions.Builder addInternalAddressRequest(int);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions.Builder addInternalAddressRequest(@NonNull java.net.InetAddress, int);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions.Builder addInternalDhcpServerRequest(int);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions.Builder addInternalDhcpServerRequest(@NonNull java.net.InetAddress);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions.Builder addInternalDnsServerRequest(int);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions.Builder addInternalDnsServerRequest(@NonNull java.net.InetAddress);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions.Builder addInternalSubnetRequest(int);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions.Builder addOutboundTrafficSelectors(@NonNull android.net.ipsec.ike.IkeTrafficSelector);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions.Builder addSaProposal(@NonNull android.net.ipsec.ike.ChildSaProposal);
    method @NonNull public android.net.ipsec.ike.TunnelModeChildSessionOptions build();
  }

}

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.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 abstract void onFailure(int);
    method public abstract void onProgress(int);
    field public static final int EASY_CONNECT_EVENT_FAILURE_AUTHENTICATION = -2; // 0xfffffffe
    field public static final int EASY_CONNECT_EVENT_FAILURE_BUSY = -5; // 0xfffffffb
    field public static final int EASY_CONNECT_EVENT_FAILURE_CONFIGURATION = -4; // 0xfffffffc
    field public static final int EASY_CONNECT_EVENT_FAILURE_GENERIC = -7; // 0xfffffff9
    field public static final int EASY_CONNECT_EVENT_FAILURE_INVALID_NETWORK = -9; // 0xfffffff7
    field public static final int EASY_CONNECT_EVENT_FAILURE_INVALID_URI = -1; // 0xffffffff
    field public static final int EASY_CONNECT_EVENT_FAILURE_NOT_COMPATIBLE = -3; // 0xfffffffd
    field public static final int EASY_CONNECT_EVENT_FAILURE_NOT_SUPPORTED = -8; // 0xfffffff8
    field public static final int EASY_CONNECT_EVENT_FAILURE_TIMEOUT = -6; // 0xfffffffa
    field public static final int EASY_CONNECT_EVENT_PROGRESS_AUTHENTICATION_SUCCESS = 0; // 0x0
    field public static final int EASY_CONNECT_EVENT_PROGRESS_RESPONSE_PENDING = 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 final class SoftApConfiguration implements android.os.Parcelable {
    method public int describeContents();
    method public int getBand();
    method @Nullable public android.net.MacAddress getBssid();
    method public int getChannel();
    method public int getSecurityType();
    method @Nullable public String getSsid();
    method @Nullable public String getWpa2Passphrase();
    method public boolean isHiddenSsid();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int BAND_2GHZ = 0; // 0x0
    field public static final int BAND_5GHZ = 1; // 0x1
    field public static final int BAND_ANY = -1; // 0xffffffff
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.SoftApConfiguration> CREATOR;
    field public static final int SECURITY_TYPE_OPEN = 0; // 0x0
    field public static final int SECURITY_TYPE_WPA2_PSK = 1; // 0x1
  }

  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 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);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setHiddenSsid(boolean);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setSsid(@Nullable String);
    method @NonNull public android.net.wifi.SoftApConfiguration.Builder setWpa2Passphrase(@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 WifiActivityEnergyInfo implements android.os.Parcelable {
    ctor public WifiActivityEnergyInfo(long, int, long, long, long, long, long);
    method public int describeContents();
    method public long getControllerEnergyUsedMicroJoules();
    method public long getControllerIdleDurationMillis();
    method public long getControllerRxDurationMillis();
    method public long getControllerScanDurationMillis();
    method public long getControllerTxDurationMillis();
    method public int getStackState();
    method public long getTimeSinceBootMillis();
    method public boolean isValid();
    method public void setControllerEnergyUsedMicroJoules(long);
    method public void setControllerIdleDurationMillis(long);
    method public void setControllerRxDurationMillis(long);
    method public void setControllerScanDurationMillis(long);
    method public void setControllerTxDurationMillis(long);
    method public void setStackState(int);
    method public void setTimeSinceBootMillis(long);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.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 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.IpAssignment getIpAssignment();
    method @Deprecated @NonNull public android.net.wifi.WifiConfiguration.NetworkSelectionStatus getNetworkSelectionStatus();
    method @Deprecated @NonNull public String getPrintableSsid();
    method @Deprecated @NonNull public android.net.IpConfiguration.ProxySettings getProxySettings();
    method @Deprecated @Nullable public android.net.StaticIpConfiguration getStaticIpConfiguration();
    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 setProxy(@NonNull android.net.IpConfiguration.ProxySettings, @NonNull android.net.ProxyInfo);
    field @Deprecated public static final int AP_BAND_2GHZ = 0; // 0x0
    field @Deprecated public static final int AP_BAND_5GHZ = 1; // 0x1
    field @Deprecated public static final int AP_BAND_ANY = -1; // 0xffffffff
    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 boolean allowAutojoin;
    field @Deprecated public int apBand;
    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 @NonNull public final android.net.wifi.WifiConfiguration.RecentFailure recentFailure;
    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 WPA2_PSK = 4; // 0x4
  }

  @Deprecated public static class WifiConfiguration.NetworkSelectionStatus {
    method @Deprecated public int getDisableReasonCounter(int);
    method @Deprecated public long getDisableTime();
    method @Deprecated public boolean getHasEverConnected();
    method @Deprecated @Nullable public static String getNetworkDisableReasonString(int);
    method @Deprecated public int getNetworkSelectionDisableReason();
    method @Deprecated @NonNull public String getNetworkStatusString();
    method @Deprecated public boolean isNetworkEnabled();
    method @Deprecated public boolean isNetworkPermanentlyDisabled();
    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_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_DISABLED_MAX = 10; // 0xa
    field @Deprecated public static final int NETWORK_SELECTION_ENABLE = 0; // 0x0
  }

  @Deprecated public static class WifiConfiguration.RecentFailure {
    method @Deprecated public int getAssociationStatus();
    field @Deprecated public static final int NONE = 0; // 0x0
    field @Deprecated public static final int STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17; // 0x11
  }

  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 public void setCaCertificateAliases(@Nullable String[]);
    method public void setCaPath(@Nullable String);
    method public void setClientCertificateAlias(@Nullable String);
    method public void setOcsp(int);
    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 @Nullable public String getAppPackageName();
    method public double getRxSuccessRate();
    method public int getScore();
    method public double getTxBadRate();
    method public double getTxRetriesRate();
    method public double getTxSuccessRate();
    method public boolean isEphemeral();
    method public boolean isOsuAp();
    method public boolean isPasspointAp();
    method @Nullable public static String removeDoubleQuotes(@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 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(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.NETWORK_SETTINGS) public void enableVerboseLogging(int);
    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(android.Manifest.permission.ACCESS_WIFI_STATE) 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 @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 public int getVerboseLoggingLevel();
    method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public android.net.wifi.WifiConfiguration getWifiApConfiguration();
    method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public int getWifiApState();
    method public boolean isApMacRandomizationSupported();
    method public boolean isConnectedMacRandomizationSupported();
    method @Deprecated public boolean isDeviceToDeviceRttSupported();
    method public boolean isDualBandSupported();
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public boolean isDualModeSupported();
    method public boolean isPortableHotspotSupported();
    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 android.net.wifi.WifiManager.NetworkRequestMatchCallback);
    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 android.net.wifi.WifiManager.SoftApCallback);
    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 android.net.wifi.WifiManager.TrafficStateCallback);
    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 void restoreSoftApBackupData(@NonNull byte[]);
    method @Deprecated @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 @Nullable @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.WIFI_SET_DEVICE_MOBILITY_STATE) public void setDeviceMobilityState(int);
    method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public boolean setSoftApConfiguration(@NonNull android.net.wifi.SoftApConfiguration);
    method @Deprecated @RequiresPermission(android.Manifest.permission.CHANGE_WIFI_STATE) public boolean setWifiApConfiguration(android.net.wifi.WifiConfiguration);
    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_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_START_FAILURE_GENERAL = 0; // 0x0
    field public static final int SAP_START_FAILURE_NO_CHANNEL = 1; // 0x1
    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.OnWifiUsabilityStatsListener {
    method public void onWifiUsabilityStats(int, boolean, @NonNull android.net.wifi.WifiUsabilityStatsEntry);
  }

  public static interface WifiManager.SoftApCallback {
    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 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 static final class WifiNetworkSuggestion.Builder {
    method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_CARRIER_PROVISIONING) public android.net.wifi.WifiNetworkSuggestion.Builder setCarrierId(int);
  }

  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 @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 @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
    method @Deprecated public void startTrackingBssids(android.net.wifi.WifiScanner.BssidInfo[], int, android.net.wifi.WifiScanner.BssidListener);
    method @Deprecated public void startTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopBackgroundScan(android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopScan(android.net.wifi.WifiScanner.ScanListener);
    method @Deprecated public void stopTrackingBssids(android.net.wifi.WifiScanner.BssidListener);
    method @Deprecated public void stopTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
    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_GHZ = 1; // 0x1
    field public static final int WIFI_BAND_5_GHZ = 2; // 0x2
    field public static final int WIFI_BAND_5_GHZ_DFS_ONLY = 4; // 0x4
    field public static final int WIFI_BAND_5_GHZ_WITH_DFS = 6; // 0x6
    field public static final int WIFI_BAND_BOTH = 3; // 0x3
    field public static final int WIFI_BAND_BOTH_WITH_DFS = 7; // 0x7
    field public static final int WIFI_BAND_UNSPECIFIED = 0; // 0x0
  }

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

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

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

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

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

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

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

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

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

  public static class WifiScanner.ScanSettings implements android.os.Parcelable {
    ctor public WifiScanner.ScanSettings();
    field public int band;
    field public android.net.wifi.WifiScanner.ChannelSpec[] channels;
    field @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 public int maxPeriodInMs;
    field public int maxScansToCache;
    field public int numBssidsPerScan;
    field public int periodInMs;
    field public int reportEvents;
    field 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 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 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.p2p {

  public final class WifiP2pGroupList implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.Collection<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(android.Manifest.permission.NETWORK_SETTINGS) public void listen(@NonNull android.net.wifi.p2p.WifiP2pManager.Channel, boolean, @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);
    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 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 noteFullWifiLockAcquiredFromSource(@NonNull android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteFullWifiLockReleasedFromSource(@NonNull android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiBatchedScanStartedFromSource(@NonNull android.os.WorkSource, @IntRange(from=0) int);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiBatchedScanStoppedFromSource(@NonNull android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiMulticastDisabled(int);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiMulticastEnabled(int);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiOff();
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiOn();
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiRssiChanged(@IntRange(from=0xffffff81, to=0) int);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiScanStartedFromSource(@NonNull android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiScanStoppedFromSource(@NonNull android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiState(int, @Nullable String);
    method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public void noteWifiSupplicantStateChanged(int, boolean);
  }

  public class Binder implements android.os.IBinder {
    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.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 @NonNull 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
  }

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

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

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

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

  public class IncidentManager {
    method @RequiresPermission(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 @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);
    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.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 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(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(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 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.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 void installPackage(android.content.Context, java.io.File, boolean) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void processPackage(android.content.Context, java.io.File, android.os.RecoverySystem.ProgressListener, android.os.Handler) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void processPackage(android.content.Context, java.io.File, android.os.RecoverySystem.ProgressListener) throws java.io.IOException;
    method @RequiresPermission(allOf={android.Manifest.permission.RECOVERY, android.Manifest.permission.REBOOT}) public static void rebootWipeAb(android.content.Context, java.io.File, String) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.RECOVERY) public static void scheduleUpdateOnBoot(android.content.Context, java.io.File) throws java.io.IOException;
    method public static boolean verifyPackageCompatibility(java.io.File) throws java.io.IOException;
  }

  public final class RemoteCallback implements android.os.Parcelable {
    ctor public RemoteCallback(android.os.RemoteCallback.OnResultListener);
    ctor public RemoteCallback(@NonNull android.os.RemoteCallback.OnResultListener, @Nullable android.os.Handler);
    method public int describeContents();
    method public void sendResult(@Nullable android.os.Bundle);
    method public void writeToParcel(android.os.Parcel, int);
    field @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 SystemProperties {
    method @NonNull public static String get(@NonNull String);
    method @NonNull public static String get(@NonNull String, @Nullable String);
    method public static boolean getBoolean(@NonNull String, boolean);
    method public static int getInt(@NonNull String, int);
    method public static long getLong(@NonNull String, long);
  }

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

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

  public static final class UpdateEngine.ErrorCodeConstants {
    ctor public UpdateEngine.ErrorCodeConstants();
    field public static final int DOWNLOAD_PAYLOAD_VERIFICATION_ERROR = 12; // 0xc
    field public static final int DOWNLOAD_TRANSFER_ERROR = 9; // 0x9
    field public static final int ERROR = 1; // 0x1
    field public static final int FILESYSTEM_COPIER_ERROR = 4; // 0x4
    field public static final int INSTALL_DEVICE_OPEN_ERROR = 7; // 0x7
    field public static final int KERNEL_DEVICE_OPEN_ERROR = 8; // 0x8
    field public static final int PAYLOAD_HASH_MISMATCH_ERROR = 10; // 0xa
    field public static final int PAYLOAD_MISMATCHED_TYPE_ERROR = 6; // 0x6
    field public static final int PAYLOAD_SIZE_MISMATCH_ERROR = 11; // 0xb
    field public static final int 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(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 @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 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(android.Manifest.permission.MANAGE_USERS) public boolean isGuestUser();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isManagedProfile();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isManagedProfile(int);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isPrimaryUser();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isRestrictedProfile();
    method @RequiresPermission(android.Manifest.permission.MANAGE_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.INTERACT_ACROSS_USERS}) public boolean isUserUnlockingOrUnlocked(@NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean removeUser(@NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void setUserIcon(@NonNull android.graphics.Bitmap);
    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
  }

  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 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 WifiBatteryStats 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 getNumAppScanRequest();
    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.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();
    field @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1
  }

}

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 @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 onUpdateUserSensitive();
    field public static final String SERVICE_INTERFACE = "android.permission.PermissionControllerService";
  }

  public final class PermissionManager {
    method @IntRange(from=0) @RequiresPermission(android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY) public int getRuntimePermissionsVersion();
    method @NonNull public java.util.List<android.permission.PermissionManager.SplitPermissionInfo> getSplitPermissions();
    method @RequiresPermission(android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY) public void setRuntimePermissionsVersion(@IntRange(from=0) int);
  }

  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 @NonNull public static final android.net.Uri AUTHORITY_URI;
    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
  }

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

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

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

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

  public 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);
    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_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";
  }

  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 final class DocumentsContract {
    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 abstract class SearchIndexableData {
    ctor public SearchIndexableData();
    ctor public SearchIndexableData(android.content.Context);
    field public String className;
    field public android.content.Context context;
    field public boolean enabled;
    field public int iconResId;
    field public String intentAction;
    field public String intentTargetClass;
    field public String intentTargetPackage;
    field public String key;
    field public java.util.Locale locale;
    field public String packageName;
    field public int rank;
    field public int userId;
  }

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

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

  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 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 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 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 THEATER_MODE_ON = "theater_mode_on";
    field public static final String WEBVIEW_MULTIPROCESS = "webview_multiprocess";
    field public static final String WIFI_BADGING_THRESHOLDS = "wifi_badging_thresholds";
    field public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
  }

  public static final class Settings.Secure extends android.provider.Settings.NameValueTable {
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static boolean putString(@NonNull android.content.ContentResolver, @NonNull String, @Nullable String, @Nullable String, boolean);
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static void resetToDefaults(@NonNull android.content.ContentResolver, @Nullable String);
    field @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 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 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 public static final int CARRIER_EDITED = 4; // 0x4
    field public static final String EDITED_STATUS = "edited";
    field public static final String MAX_CONNECTIONS = "max_conns";
    field public static final String MODEM_PERSIST = "modem_cognitive";
    field public static final String MTU = "mtu";
    field public static final int NO_APN_SET_ID = 0; // 0x0
    field public static final String TIME_LIMIT_FOR_MAX_CONNECTIONS = "max_conns_time";
    field public static final int UNEDITED = 0; // 0x0
    field public static final int USER_DELETED = 2; // 0x2
    field public static final String USER_EDITABLE = "user_editable";
    field public static final int USER_EDITED = 1; // 0x1
    field public static final String USER_VISIBLE = "user_visible";
    field public static final String WAIT_TIME_RETRY = "wait_time";
  }

  public static final class Telephony.CellBroadcasts implements android.provider.BaseColumns {
    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 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 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_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 SUB_ID = "sub_id";
  }

  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.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";
  }

}

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 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);
    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.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 setFillWindow(@NonNull android.service.autofill.augmented.FillWindow);
  }

  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 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 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.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 @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_PEOPLE = "key_people";
    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 onNotificationsSeen(@NonNull java.util.List<java.lang.String>);
    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.sms {

  public abstract class FinancialSmsService extends android.app.Service {
    method public android.os.IBinder onBind(android.content.Intent);
    method @Nullable public abstract android.database.CursorWindow onGetSmsMessages(@NonNull android.os.Bundle);
    field public static final String ACTION_FINANCIAL_SERVICE_INTENT = "android.service.sms.action.FINANCIAL_SERVICE_INTENT";
  }

}

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.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 public android.telecom.CallScreeningService.CallResponse.Builder setShouldScreenCallFurther(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 final long getConnectionStartElapsedRealTime();
    method public android.telecom.Connection getPrimaryConnection();
    method @NonNull public final String getTelecomCallId();
    method @Deprecated public void onAudioStateChanged(android.telecom.AudioState);
    method public final void setAddress(@NonNull android.net.Uri, int);
    method public final void setCallerDisplayName(@NonNull String, int);
    method 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 public final long getConnectElapsedTimeMillis();
    method public final long getConnectTimeMillis();
    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 public final void setConnectTimeMillis(long);
    method public final void setConnectionStartElapsedRealTime(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_MULTI_USER = 32; // 0x20
  }

  public static class PhoneAccount.Builder {
    method @NonNull 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(int);
    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 EXTRA_CALL_BACK_INTENT = "android.telecom.extra.CALL_BACK_INTENT";
    field public static final String EXTRA_CLEAR_MISSED_CALLS_INTENT = "android.telecom.extra.CLEAR_MISSED_CALLS_INTENT";
    field public static final String EXTRA_CONNECTION_SERVICE = "android.telecom.extra.CONNECTION_SERVICE";
    field public static final String EXTRA_IS_USER_INTENT_EMERGENCY_CALL = "android.telecom.extra.IS_USER_INTENT_EMERGENCY_CALL";
    field public static final int TTY_MODE_FULL = 1; // 0x1
    field public static final int TTY_MODE_HCO = 2; // 0x2
    field public static final int TTY_MODE_OFF = 0; // 0x0
    field public static final int TTY_MODE_VCO = 3; // 0x3
  }

}

package android.telephony {

  public final class AccessNetworkConstants {
    field public static final int TRANSPORT_TYPE_INVALID = -1; // 0xffffffff
    field public static final int TRANSPORT_TYPE_WLAN = 2; // 0x2
    field public static final int TRANSPORT_TYPE_WWAN = 1; // 0x1
  }

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

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

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

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

  public final class 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_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, @Nullable 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 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 public int describeContents();
    method public int getAccessNetworkTechnology();
    method @NonNull public java.util.List<java.lang.Integer> getAvailableServices();
    method @Nullable public android.telephony.CellIdentity getCellIdentity();
    method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo();
    method public int getDomain();
    method public int getNrState();
    method public int getRegistrationState();
    method public int getRejectCause();
    method public int getRoamingType();
    method public int getTransportType();
    method public boolean isEmergencyEnabled();
    method public boolean isRoaming();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.NetworkRegistrationInfo> CREATOR;
    field public static final int DOMAIN_CS = 1; // 0x1
    field public static final int DOMAIN_PS = 2; // 0x2
    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
    field public static final int SERVICE_TYPE_DATA = 2; // 0x2
    field public static final int SERVICE_TYPE_EMERGENCY = 5; // 0x5
    field public static final int SERVICE_TYPE_SMS = 3; // 0x3
    field public static final int SERVICE_TYPE_UNKNOWN = 0; // 0x0
    field public static final int SERVICE_TYPE_VIDEO = 4; // 0x4
    field public static final int SERVICE_TYPE_VOICE = 1; // 0x1
  }

  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 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 @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onCallDisconnectCauseChanged(int, int);
    method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onImsCallDisconnectCauseChanged(@NonNull android.telephony.ims.ImsReasonInfo);
    method 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 @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onPreciseDataConnectionStateChanged(@NonNull android.telephony.PreciseDataConnectionState);
    method public void onRadioPowerStateChanged(int);
    method public void onSrvccStateChanged(int);
    method public void onVoiceActivationStateChanged(int);
    field public static final int LISTEN_CALL_ATTRIBUTES_CHANGED = 67108864; // 0x4000000
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_CALL_DISCONNECT_CAUSES = 33554432; // 0x2000000
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_IMS_CALL_DISCONNECT_CAUSES = 134217728; // 0x8000000
    field @RequiresPermission(android.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.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_PRECISE_DATA_CONNECTION_STATE = 4096; // 0x1000
    field public static final int LISTEN_RADIO_POWER_STATE_CHANGED = 8388608; // 0x800000
    field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_SRVCC_STATE_CHANGED = 16384; // 0x4000
    field public static final int LISTEN_VOICE_ACTIVATION_STATE = 131072; // 0x20000
  }

  public final class PreciseCallState implements android.os.Parcelable {
    method public int describeContents();
    method public int getBackgroundCallState();
    method public int getForegroundCallState();
    method public int getRingingCallState();
    method public void writeToParcel(android.os.Parcel, int);
    field @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 {
    method public int describeContents();
    method @Nullable public String getDataConnectionApn();
    method public int getDataConnectionApnTypeBitMask();
    method public int getDataConnectionFailCause();
    method public int getDataConnectionState();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.PreciseDataConnectionState> CREATOR;
  }

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

  public class ServiceState implements android.os.Parcelable {
    method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int);
    method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoList();
    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();
    field public static final int ROAMING_TYPE_DOMESTIC = 2; // 0x2
    field public static final int ROAMING_TYPE_INTERNATIONAL = 3; // 0x3
    field public static final int ROAMING_TYPE_NOT_ROAMING = 0; // 0x0
    field public static final int ROAMING_TYPE_UNKNOWN = 1; // 0x1
  }

  public final class 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, @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 @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 public boolean disableCellBroadcastRange(int, int, int);
    method public boolean enableCellBroadcastRange(int, int, int);
    method public void sendMultipartTextMessage(@NonNull String, @NonNull 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>);
  }

  public class SubscriptionInfo implements android.os.Parcelable {
    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 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 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);
    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();
  }

  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 @Deprecated @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void call(String, String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void carrierActionReportDefaultNetworkStatus(int, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void carrierActionResetAll(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void carrierActionSetRadioEnabled(int, boolean);
    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 @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 @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.CarrierRestrictionRules getCarrierRestrictionRules();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMdn();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMdn(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMin();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String getCdmaMin(int);
    method public String getCdmaPrlVersion();
    method public int getCurrentPhoneType();
    method public int getCurrentPhoneType(int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getDataActivationState();
    method @Deprecated public boolean getDataEnabled();
    method @Deprecated public boolean getDataEnabled(int);
    method @Nullable public static android.content.ComponentName getDefaultRespondViaMessageApplication(@NonNull android.content.Context, boolean);
    method @NonNull public static String getDefaultSimCountryIso();
    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 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 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 @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 @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public String iccTransmitApduBasicChannelBySlot(int, int, int, int, int, int, @Nullable String);
    method @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 isApplicationOnUicc(int);
    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 @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.READ_PRIVILEGED_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 needsOtaServiceProvisioning();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyOtaEmergencyNumberDbInstalled();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean rebootRadio();
    method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.MODIFY_PHONE_STATE}) public void requestCellInfoUpdate(@NonNull android.os.WorkSource, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CellInfoCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void requestNumberVerification(@NonNull android.telephony.PhoneNumberRange, long, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.NumberVerificationCallback);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void resetCarrierKeysForImsiEncryption();
    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 void setCarrierDataEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setCarrierRestrictionRules(@NonNull android.telephony.CarrierRestrictionRules);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int);
    method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setOpportunisticNetworkState(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 boolean setRadioPower(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerState(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerStateForSlot(int, int);
    method @Deprecated public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoiceActivationState(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPin(String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPinReportResult(String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean supplyPuk(String, String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int[] supplyPukReportResult(String, String);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean switchSlots(int[]);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void toggleRadioOnOff();
    method public void updateServiceLocation();
    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_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED";
    field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED";
    field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED";
    field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
    field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
    field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
    field public static final int CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED = -1; // 0xffffffff
    field public static final String EXTRA_ANOMALY_DESCRIPTION = "android.telephony.extra.ANOMALY_DESCRIPTION";
    field public static final String EXTRA_ANOMALY_ID = "android.telephony.extra.ANOMALY_ID";
    field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
    field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
    field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
    field public static final 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 long NETWORK_TYPE_BITMASK_1xRTT = 64L; // 0x40L
    field public static final long NETWORK_TYPE_BITMASK_CDMA = 8L; // 0x8L
    field public static final long NETWORK_TYPE_BITMASK_EDGE = 2L; // 0x2L
    field public static final long NETWORK_TYPE_BITMASK_EHRPD = 8192L; // 0x2000L
    field public static final long NETWORK_TYPE_BITMASK_EVDO_0 = 16L; // 0x10L
    field public static final long NETWORK_TYPE_BITMASK_EVDO_A = 32L; // 0x20L
    field public static final long NETWORK_TYPE_BITMASK_EVDO_B = 2048L; // 0x800L
    field public static final long NETWORK_TYPE_BITMASK_GPRS = 1L; // 0x1L
    field public static final long NETWORK_TYPE_BITMASK_GSM = 32768L; // 0x8000L
    field public static final long NETWORK_TYPE_BITMASK_HSDPA = 128L; // 0x80L
    field public static final long NETWORK_TYPE_BITMASK_HSPA = 512L; // 0x200L
    field public static final long NETWORK_TYPE_BITMASK_HSPAP = 16384L; // 0x4000L
    field public static final long NETWORK_TYPE_BITMASK_HSUPA = 256L; // 0x100L
    field public static final long NETWORK_TYPE_BITMASK_IWLAN = 131072L; // 0x20000L
    field public static final long NETWORK_TYPE_BITMASK_LTE = 4096L; // 0x1000L
    field public static final long NETWORK_TYPE_BITMASK_LTE_CA = 262144L; // 0x40000L
    field public static final long NETWORK_TYPE_BITMASK_NR = 524288L; // 0x80000L
    field public static final long NETWORK_TYPE_BITMASK_TD_SCDMA = 65536L; // 0x10000L
    field public static final long NETWORK_TYPE_BITMASK_UMTS = 4L; // 0x4L
    field public static final long NETWORK_TYPE_BITMASK_UNKNOWN = 0L; // 0x0L
    field public static final int RADIO_POWER_OFF = 0; // 0x0
    field public static final int RADIO_POWER_ON = 1; // 0x1
    field public static final int RADIO_POWER_UNAVAILABLE = 2; // 0x2
    field public static final int SET_CARRIER_RESTRICTION_ERROR = 2; // 0x2
    field public static final int SET_CARRIER_RESTRICTION_NOT_SUPPORTED = 1; // 0x1
    field public static final int SET_CARRIER_RESTRICTION_SUCCESS = 0; // 0x0
    field public static final int SIM_ACTIVATION_STATE_ACTIVATED = 2; // 0x2
    field public static final int SIM_ACTIVATION_STATE_ACTIVATING = 1; // 0x1
    field public static final int SIM_ACTIVATION_STATE_DEACTIVATED = 3; // 0x3
    field public static final int SIM_ACTIVATION_STATE_RESTRICTED = 4; // 0x4
    field public static final int SIM_ACTIVATION_STATE_UNKNOWN = 0; // 0x0
    field public static final int SIM_STATE_LOADED = 10; // 0xa
    field public static final int SIM_STATE_PRESENT = 11; // 0xb
    field public static final int SRVCC_STATE_HANDOVER_CANCELED = 3; // 0x3
    field public static final int SRVCC_STATE_HANDOVER_COMPLETED = 1; // 0x1
    field public static final int SRVCC_STATE_HANDOVER_FAILED = 2; // 0x2
    field public static final int SRVCC_STATE_HANDOVER_NONE = -1; // 0xffffffff
    field public static final int SRVCC_STATE_HANDOVER_STARTED = 0; // 0x0
  }

  public 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 @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyCallStateChangedForAllSubscriptions(int, @Nullable String);
    method public void notifyCarrierNetworkChange(boolean);
    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 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 public int getMtu();
    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 @NonNull public android.telephony.data.DataCallResponse.Builder setMtu(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 public int getMtu();
    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 @NonNull public android.telephony.data.DataProfile.Builder setMtu(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();
    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 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_RAT_TYPE = "CallRadioTech";
    field public static final String EXTRA_CHILD_NUMBER = "ChildNum";
    field public static final String EXTRA_CNA = "cna";
    field public static final String EXTRA_CNAP = "cnap";
    field public static final String EXTRA_CODEC = "Codec";
    field public static final String EXTRA_DIALSTRING = "dialstring";
    field public static final String EXTRA_DISPLAY_TEXT = "DisplayText";
    field public static final String EXTRA_EMERGENCY_CALL = "e_call";
    field public static final String EXTRA_IS_CALL_PULL = "CallPull";
    field public static final String EXTRA_OI = "oi";
    field public static final String EXTRA_OIR = "oir";
    field public static final String EXTRA_REMOTE_URI = "remote_uri";
    field public static final String EXTRA_USSD = "ussd";
    field public static final int OIR_DEFAULT = 0; // 0x0
    field public static final int OIR_PRESENTATION_NOT_RESTRICTED = 2; // 0x2
    field public static final int OIR_PRESENTATION_PAYPHONE = 4; // 0x4
    field public static final int OIR_PRESENTATION_RESTRICTED = 1; // 0x1
    field public static final int OIR_PRESENTATION_UNKNOWN = 3; // 0x3
    field public static final int SERVICE_TYPE_EMERGENCY = 2; // 0x2
    field public static final int SERVICE_TYPE_NONE = 0; // 0x0
    field public static final int SERVICE_TYPE_NORMAL = 1; // 0x1
    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 public void callSessionHandover(int, int, android.telephony.ims.ImsReasonInfo);
    method public void callSessionHandoverFailed(int, int, android.telephony.ims.ImsReasonInfo);
    method public void callSessionHeld(android.telephony.ims.ImsCallProfile);
    method public void callSessionHoldFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionHoldReceived(android.telephony.ims.ImsCallProfile);
    method public void callSessionInitiated(android.telephony.ims.ImsCallProfile);
    method public void callSessionInitiatedFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionInviteParticipantsRequestDelivered();
    method public void callSessionInviteParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionMayHandover(int, int);
    method public void callSessionMergeComplete(android.telephony.ims.stub.ImsCallSessionImplBase);
    method public void callSessionMergeFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionMergeStarted(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile);
    method public void callSessionMultipartyStateChanged(boolean);
    method public void callSessionProgressing(android.telephony.ims.ImsStreamMediaProfile);
    method public void callSessionRemoveParticipantsRequestDelivered();
    method public void callSessionRemoveParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionResumeFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionResumeReceived(android.telephony.ims.ImsCallProfile);
    method public void callSessionResumed(android.telephony.ims.ImsCallProfile);
    method public void callSessionRttAudioIndicatorChanged(@NonNull android.telephony.ims.ImsStreamMediaProfile);
    method public void callSessionRttMessageReceived(String);
    method public void callSessionRttModifyRequestReceived(android.telephony.ims.ImsCallProfile);
    method public void callSessionRttModifyResponseReceived(int);
    method public void callSessionSuppServiceReceived(android.telephony.ims.ImsSuppServiceNotification);
    method public void callSessionTerminated(android.telephony.ims.ImsReasonInfo);
    method public void callSessionTtyModeReceived(int);
    method public void callSessionUpdateFailed(android.telephony.ims.ImsReasonInfo);
    method public void callSessionUpdateReceived(android.telephony.ims.ImsCallProfile);
    method public void callSessionUpdated(android.telephony.ims.ImsCallProfile);
    method public void callSessionUssdMessageReceived(int, String);
  }

  public final class ImsConferenceState implements android.os.Parcelable {
    method public int describeContents();
    method public static int getConnectionStateForStatus(String);
    method public void writeToParcel(android.os.Parcel, int);
    field @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);
    method public int getCode();
    field public static final int CODE_ERROR_SERVICE_UNAVAILABLE = 1; // 0x1
    field public static final int CODE_ERROR_UNSPECIFIED = 0; // 0x0
    field public static final int CODE_ERROR_UNSUPPORTED_OPERATION = 2; // 0x2
  }

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

  public class ImsMmTelManager implements android.telephony.ims.RegistrationManager {
    method @NonNull 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 void getRegistrationTransportType(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoWiFiModeSetting();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getVoWiFiRoamingModeSetting();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAdvancedCallingSettingEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAvailable(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isCapable(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void isSupported(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>) throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isTtyOverVolteEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isVoWiFiRoamingSettingEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isVoWiFiSettingEnabled();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isVtSettingEnabled();
    method @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.READ_PRIVILEGED_PHONE_STATE) public void registerImsRegistrationCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.RegistrationManager.RegistrationCallback) throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerMmTelCapabilityCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ImsMmTelManager.CapabilityCallback) throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setAdvancedCallingSettingEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setRttCapabilitySetting(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiModeSetting(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiNonPersistent(boolean, int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingModeSetting(int);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingSettingEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiSettingEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVtSettingEnabled(boolean);
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.RegistrationManager.RegistrationCallback);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterMmTelCapabilityCallback(@NonNull android.telephony.ims.ImsMmTelManager.CapabilityCallback);
    field public static final int WIFI_MODE_CELLULAR_PREFERRED = 1; // 0x1
    field public static final int WIFI_MODE_WIFI_ONLY = 0; // 0x0
    field public static final int WIFI_MODE_WIFI_PREFERRED = 2; // 0x2
  }

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

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

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

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

  public interface RegistrationManager {
    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 void getRegistrationTransportType(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerImsRegistrationCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.RegistrationManager.RegistrationCallback) throws android.telephony.ims.ImsException;
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.RegistrationManager.RegistrationCallback);
    field public static final int REGISTRATION_STATE_NOT_REGISTERED = 0; // 0x0
    field public static final int REGISTRATION_STATE_REGISTERED = 2; // 0x2
    field public static final int REGISTRATION_STATE_REGISTERING = 1; // 0x1
  }

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

}

package android.telephony.ims.feature {

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

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

  public abstract class ImsFeature {
    ctor public ImsFeature();
    method public abstract void changeEnabledCapabilities(android.telephony.ims.feature.CapabilityChangeRequest, android.telephony.ims.feature.ImsFeature.CapabilityCallbackProxy);
    method public 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(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int, int);
    method public final android.telephony.ims.feature.MmTelFeature.MmTelCapabilities queryCapabilityStatus();
    method public void setUiTtyMode(int, @Nullable android.os.Message);
    method @android.telephony.ims.feature.MmTelFeature.ProcessCallResult public int shouldProcessCall(@NonNull String[]);
    field public static final 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(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int);
    method public final void addCapabilities(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int);
    method public final boolean isCapable(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int);
    method public final void removeCapabilities(@android.telephony.ims.feature.MmTelFeature.MmTelCapabilities.MmTelCapability int);
    field public static final int CAPABILITY_TYPE_SMS = 8; // 0x8
    field public static final int CAPABILITY_TYPE_UT = 4; // 0x4
    field public static final int CAPABILITY_TYPE_VIDEO = 2; // 0x2
    field public static final int CAPABILITY_TYPE_VOICE = 1; // 0x1
  }

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

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

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

}

package android.telephony.ims.stub {

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

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

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

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

  public final class ImsFeatureConfiguration implements android.os.Parcelable {
    method public int describeContents();
    method public java.util.Set<android.telephony.ims.stub.ImsFeatureConfiguration.FeatureSlotPair> getServiceFeatures();
    method public void writeToParcel(android.os.Parcel, int);
    field @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 updateCallForward(int, int, String, int, int);
    method public int updateCallWaiting(boolean, int);
    method public int updateClip(boolean);
    method public int updateClir(int);
    method public int updateColp(boolean);
    method public int updateColr(int);
  }

}

package android.telephony.mbms {

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

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

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

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

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

  public final class UriPathPair implements android.os.Parcelable {
    method public int describeContents();
    method public android.net.Uri getContentUri();
    method public android.net.Uri getFilePathUri();
    method public void writeToParcel(android.os.Parcel, int);
    field @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 StatsLog {
    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();
  }

}

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

}

